Integrated Circuit Having Inverse Bit Storage Test

ABSTRACT

An integrated circuit is provided having a memory storing first and second strings of bit values, each bit value in the second string being the logical inverse of a bit value at a corresponding bit position in the first string, and a processor configured to test whether the bit values of the second string are the inverse of the bit values at respective corresponding bit positions of the first string by combining the corresponding bits of the first and second strings.

CROSS REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. application Ser. No. 10/727,159 filed Dec. 2, 2003 all of which are herein incorporated by reference.

FIELD OF INVENTION

The present invention relates to securing an integrated circuit against certain forms of security attacks.

The invention has primarily been developed for use in chips used in a printer system to authenticate communications between, for example, a printer controller and other peripheral devices such as ink cartridges. However, it will be appreciated that the invention can be applied to integrated circuits in other fields in which analogous problems are faced.

BACKGROUND OF INVENTION

Manufacturing a printhead that has relatively high resolution and print-speed raises a number of problems.

Difficulties in manufacturing pagewidth printheads of any substantial size arise due to the relatively small dimensions of standard silicon wafers that are used in printhead (or printhead module) manufacture. For example, if it is desired to make an 8 inch wide pagewidth printhead, only one such printhead can be laid out on a standard 8-inch wafer, since such wafers are circular in plan. Manufacturing a pagewidth printhead from two or more smaller modules can reduce this limitation to some extent, but raises other problems related to providing a joint between adjacent printhead modules that is precise enough to avoid visible artifacts (which would typically take the form of noticeable lines) when the printhead is used. The problem is exacerbated in relatively high-resolution applications because of the tight tolerances dictated by the small spacing between nozzles.

The quality of a joint region between adjacent printhead modules relies on factors including a precision with which the abutting ends of each module can be manufactured, the accuracy with which they can be aligned when assembled into a single printhead, and other more practical factors such as management of ink channels behind the nozzles. It will be appreciated that the difficulties include relative vertical displacement of the printhead modules with respect to each other.

Whilst some of these issues may be dealt with by careful design and manufacture, the level of precision required renders it relatively expensive to manufacture printheads within the required tolerances. It would be desirable to provide a solution to one or more of the problems associated with precision manufacture and assembly of multiple printhead modules to form a printhead, and especially a pagewidth printhead.

In some cases, it is desirable to produce a number of different printhead module types or lengths on a substrate to maximise usage of the substrate's surface area. However, different sizes and types of modules will have different numbers and layouts of print nozzles, potentially including different horizontal and vertical offsets. Where two or more modules are to be joined to form a single printhead, there is also the problem of dealing with different seam shapes between abutting ends of joined modules, which again may incorporate vertical or horizontal offsets between the modules. Printhead controllers are usually dedicated application specific integrated circuits (ASICs) designed for specific use with a single type of printhead module, that is used by itself rather than with other modules. It would be desirable to provide a way in which different lengths and types of printhead modules could be accounted for using a single printer controller.

Printer controllers face other difficulties when two or more printhead modules are involved, especially if it is desired to send dot data to each of the printheads directly (rather than via a single printhead connected to the controller). One concern is that data delivered to different length controllers at the same rate will cause the shorter of the modules to be ready for printing before any longer modules. Where there is little difference involved, the issue may not be of importance, but for large length differences, the result is that the bandwidth of a shared memory from which the dot data is supplied to the modules is effectively left idle once one of the modules is full and the remaining module or modules is still being filled. It would be desirable to provide a way of improving memory bandwidth usage in a system comprising a plurality of printhead modules of uneven length.

In any printing system that includes multiple nozzles on a printhead or printhead module, there is the possibility of one or more of the nozzles failing in the field, or being inoperative due to manufacturing defect. Given the relatively large size of a typical printhead module, it would be desirable to provide some form of compensation for one or more “dead” nozzles. Where the printhead also outputs fixative on a per-nozzle basis, it is also desirable that the fixative is provided in such a way that dead nozzles are compensated for.

A printer controller can take the form of an integrated circuit, comprising a processor and one or more peripheral hardware units for implementing specific data manipulation functions. A number of these units and the processor may need access to a common resource such as memory. One way of arbitrating between multiple access requests for a common resource is timeslot arbitration, in which access to the resource is guaranteed to a particular requester during a predetermined timeslot.

One difficulty with this arrangement lies in the fact that not all access requests make the same demands on the resource in terms of timing and latency. For example, a memory read requires that data be fetched from memory, which may take a number of cycles, whereas a memory write can commence immediately. Timeslot arbitration does not take into account these differences, which may result in accesses being performed in a less efficient manner than might otherwise be the case. It would be desirable to provide a timeslot arbitration scheme that improved this efficiency as compared with prior art timeslot arbitration schemes.

Also of concern when allocating resources in a timeslot arbitration scheme is the fact that the priority of an access request may not be the same for all units. For example, it would be desirable to provide a timeslot arbitration scheme in which one requestor (typically the memory) is granted special priority such that its requests are dealt with earlier than would be the case in the absence of such priority.

In systems that use a memory and cache, a cache miss (in which an attempt to load data or an instruction from a cache fails) results in a memory access followed by a cache update. It is often desirable when updating the cache in this way to update data other than that which was actually missed. A typical example would be a cache miss for a byte resulting in an entire word or line of the cache associated with that byte being updated. However, this can have the effect of tying up bandwidth between the memory (or a memory manager) and the processor where the bandwidth is such that several cycles are required to transfer the entire word or line to the cache. It would be desirable to provide a mechanism for updating a cache that improved cache update speed and/or efficiency. Most integrated circuits an externally provided signal as (or to generate) a clock, often provided from a dedicated clock generation circuit. This is often due to the difficulties of providing an onboard clock that can operate at a speed that is predictable. Manufacturing tolerances of such on-board clock generation circuitry can result in clock rates that vary by a factor of two, and operating temperatures can increase this margin by an additional factor of two. In some cases, the particular rate at which the clock operates is not of particular concern. However, where the integrated circuit will be writing to an internal circuit that is sensitive to the time over which a signal is provided, it may be undesirable to have the signal be applied for too long or short a time. For example, flash memory is sensitive to being written too for too long a period. It would be desirable to provide a mechanism for adjusting a rate of an on-chip system clock to take into account the impact of manufacturing variations on clockspeed.

One form of attacking a secure chip is to induce (usually by increasing) a clock speed that takes the logic outside its rated operating frequency. One way of doing this is to reduce the temperature of the integrated circuit, which can cause the clock to race. Above a certain frequency, some logic will start malfunctioning. In some cases, the malfunction can be such that information on the chip that would otherwise be secure may become available to an external connection. It would be desirable to protect an integrated circuit from such attacks.

In an integrated circuit comprising non-volatile memory, a power failure can result in unintentional behaviour. For example, if an address or data becomes unreliable due to falling voltage supplied to the circuit but there is still sufficient power to cause a write, incorrect data can be written. Even worse, the data (incorrect or not) could be written to the wrong memory. The problem is exacerbated with multi-word writes. It would be desirable to provide a mechanism for reducing or preventing spurious writes when power to an integrated circuit is failing.

In an integrated circuit, it is often desirable to reduce unauthorised access to the contents of memory. This is particularly the case where the memory includes a key or some other form of security information that allows the integrated circuit to communicate with another entity (such as another integrated circuit, for example) in a secure manner. It would be particularly advantageous to prevent attacks involving direct probing of memory addresses by physically investigating the chip (as distinct from electronic or logical attacks via manipulation of signals and power supplied to the integrated circuit). It is also desirable to provide an environment where the manufacturer of the integrated circuit (or some other authorised entity) can verify or authorize code to be run on an integrated circuit.

Another desideratum would be the ability of two or more entities, such as integrated circuits, to communicate with each other in a secure manner. It would also be desirable to provide a mechanism for secure communication between a first entity and a second entity, where the two entities, whilst capable of some form of secure communication, are not able to establish such communication between themselves.

In a system that uses resources (such as a printer, which uses inks) it may be desirable to monitor and update a record related to resource usage. Authenticating ink quality can be a major issue, since the attributes of inks used by a given printhead can be quite specific. Use of incorrect ink can result in anything from misfiring or poor performance to damage or destruction of the printhead. It would therefore be desirable to provide a system that enables authentication of the correct ink being used, as well as providing various support systems secure enabling refilling of ink cartridges.

In a system that prevents unauthorized programs from being loaded onto or run on an integrated circuit, it can be laborious to allow developers of software to access the circuits during software development. Enabling access to integrated circuits of a particular type requires authenticating software with a relatively high-level key. Distributing the key for use by developers is inherently unsafe, since a single leak of the key outside the organization could endanger security of all chips that use a related key to authorize programs. Having a small number of people with high-security clearance available to authenticate programs for testing can be inconvenient, particularly in the case where frequent incremental changes in programs during development require testing. It would be desirable to provide a mechanism for allowing access to one or more integrated circuits without risking the security of other integrated circuits in a series of such integrated circuits.

In symmetric key security, a message, denoted by M, is plaintext. The process of transforming M into ciphertext C, where the substance of M is hidden, is called encryption. The process of transforming C back into M is called decryption. Referring to the encryption function as E, and the decryption function as D, we have the following identities:

E[M]=C

D[C]=M

Therefore the following identity is true:

D[E[M]]=M

A symmetric encryption algorithm is one where:

-   -   the encryption function E relies on key K₁,     -   the decryption function D relies on key K₂,     -   K₂ can be derived from K₁, and     -   K₁ can be derived from K₂.

In most symmetric algorithms, K₁ equals K₂. However, even if K₁ does not equal K₂, given that one key can be derived from the other, a single key K can suffice for the mathematical definition. Thus:

E_(K)[M]=C

D_(K)[C]=M

The security of these algorithms rests very much in the key K. Knowledge of K allows anyone to encrypt or decrypt. Consequently K must remain a secret for the duration of the value of M. For example, M may be a wartime message “My current position is grid position 123-456”. Once the war is over the value of M is greatly reduced, and if K is made public, the knowledge of the combat unit's position may be of no relevance whatsoever. The security of the particular symmetric algorithm is a function of two things: the strength of the algorithm and the length of the key.

An asymmetric encryption algorithm is one where:

-   -   the encryption function E relies on key K₁,     -   the decryption function D relies on key K₂,     -   K₂ cannot be derived from K₁ in a reasonable amount of time, and     -   K₁ cannot be derived from K₂ in a reasonable amount of time.

Thus:

E_(K1)[M]=C

D_(K2)[C]=M

These algorithms are also called public-key because one key K₁ can be made public. Thus anyone can encrypt a message (using K₁) but only the person with the corresponding decryption key (K₂) can decrypt and thus read the message.

In most cases, the following identity also holds:

E_(K2)[M]=C

D_(K1)[C]=M

This identity is very important because it implies that anyone with the public key K₁ can see M and know that it came from the owner of K₂. No-one else could have generated C because to do so would imply knowledge of K₂. This gives rise to a different application, unrelated to encryption—digital signatures.

A number of public key cryptographic algorithms exist. Most are impractical to implement, and many generate a very large C for a given M or require enormous keys. Still others, while secure, are far too slow to be practical for several years. Because of this, many public key systems are hybrid—a public key mechanism is used to transmit a symmetric session key, and then the session key is used for the actual messages.

All of the algorithms have a problem in terms of key selection. A random number is simply not secure enough. The two large primes p and q must be chosen carefully—there are certain weak combinations that can be factored more easily (some of the weak keys can be tested for). But nonetheless, key selection is not a simple matter of randomly selecting 1024 bits for example. Consequently the key selection process must also be secure. Symmetric and asymmetric schemes both suffer from a difficulty in allowing establishment of multiple relationships between one entity and a two or more others, without the need to provide multiple sets of keys. For example, if a main entity wants to establish secure communications with two or more additional entities, it will need to maintain a different key for each of the additional entities. For practical reasons, it is desirable to avoid generating and storing large numbers of keys. To reduce key numbers, two or more of the entities may use the same key to communicate with the main entity. However, this means that the main entity cannot be sure which of the entities it is communicating with. Similarly, messages from the main entity to one of the entities can be decrypted by any of the other entities with the same key. It would be desirable if a mechanism could be provided to allow secure communication between a main entity and one or more other entities that overcomes at least some of the shortcomings of prior art. In a system where a first entity is capable of secure communication of some form, it may be desirable to establish a relationship with another entity without providing the other entity with any information related the first entity's security features. Typically, the security features might include a key or a cryptographic function. It would be desirable to provide a mechanism for enabling secure communications between a first and second entity when they do not share the requisite secret function, key or other relationship to enable them to establish trust.

A number of other aspects, features, preferences and embodiments are disclosed in the Detailed Description of the Preferred Embodiment below.

SUMMARY OF THE INVENTION

In accordance with a first aspect of the invention, there is provided an integrated circuit comprising a processor and memory storing:

-   -   secret information accessible via a first address, the secret         information comprising a string of bit values;     -   an inverse-string accessible via a second address, the         inverse-string comprising a string of bit values, wherein each         of the bit values in the inverse-string is the logical inverse         of a bit value at a corresponding bit position in the secret         information, the integrated circuit being programmed with code         configured to:         (i) receive a request for the secret information; and         (ii) test whether the bit-values of the inverse string are the         inverse of the bit-values at respective corresponding bit         positions of the secret information.

In accordance with a second aspect of the invention, there is provided a method of ensuring validity of secret information stored in a memory in the form of a string of bit values accessible via a first address, the memory also storing an inverse-string accessible via a second address, the inverse-string comprising a string of bit values that are the logical inverses of the bit values at corresponding respective bit positions of the secret information, the method including the steps of:

receiving a request for the secret information; and testing whether the bit-values of the inverse string are the inverse of the bit-values at respective corresponding bit positions of the secret information.

Preferably, the integrated circuit is configured and programmed to perform a defensive action in the event the test fails.

More preferably, the defensive action includes deleting or destroying some or all of the contents of the memory in the event the test fails. Preferably, the defensive action includes deleting or destroying at least the secret information and/or the inverse string. Preferably, the defensive action includes preventing the processor from executing software.

Preferably, the defensive action includes resetting some or all of logic on the integrated circuit.

Preferably, the first and second addresses are at the same address in the memory.

Preferably, the string and inverse string are stored at different sub-addresses within the same address.

In accordance with a third aspect of the invention, there is provided method of manufacturing a plurality of the integrated circuits defined in claim 1, comprising the steps, for each of the plurality of integrated circuits, of:

-   -   storing the secret information and the inverse string at the         first and second addresses in the memory of the integrated         circuit; and     -   storing the code on the integrated circuit;     -   wherein the first and second addresses are randomly,         pseudo-randomly or arbitrarily selected for each of the         integrated circuits and the code for each integrated circuit is         customised to know the first and second addresses of its secret         information and inverse string.

Preferably, the first and second addresses are restricted to one of two potential locations in the memory of each integrated circuit, the secret information and the inverse string for each integrated circuit being allocated to the first and second addresses randomly, pseudo-randomly or arbitrarily.

More preferably, the secret information differs between at least two of the integrated circuits.

BRIEF DESCRIPTION OF THE DRAWINGS

Preferred and other embodiments of the invention will now be described, by way of example only, with reference to the accompanying drawings, in which:

FIG. 1 is an example of a single printer controller (hereinafter “SoPEC”) A4 simplex printer system

FIG. 2 is an example of a dual SoPEC A4 duplex printer system

FIG. 3 is an example of a dual SoPEC A3 simplex printer system

FIG. 4 is an example of a quad SoPEC A3 duplex printer system

FIG. 5 is an example of a SoPEC A4 simplex printing system with an extra SoPEC used as DRAM storage

FIG. 6 is an example of an A3 duplex printing system featuring four printing SoPECs

FIG. 7 shows pages containing different numbers of bands

FIG. 8 shows the contents of a page band

FIG. 9 illustrates a page data path from host to SoPEC

FIG. 10 shows a page structure

FIG. 11 shows a SoPEC system top level partition

FIG. 12 shows a SoPEC CPU memory map (not to scale)

FIG. 13 is a block diagram of CPU

FIG. 14 shows a printhead nozzle layout for 36-nozzle bi-lithic printhead

FIG. 15 shows a printhead nozzle layout for a 36-nozzle bi-lithic printhead

FIG. 16 shows printhead types 0 to 7

FIG. 17 shows an ideal join between two dilithic printhead segments

FIG. 18 shows an example of a join between two bilithic printhead segments

FIG. 19 shows relationship between datasets

FIG. 20 shows a validation hierarchy

FIG. 21 shows development of operating system code

FIG. 22 shows clock filter

FIG. 23 shows tamper detection line

FIG. 24 shows an oversize nMOS transistor layout of Tamper Detection Line

FIG. 25 shows a Tamper Detection Line

FIG. 26 shows how Tamper Detection Lines cover the Noise Generator

FIG. 27 shows a high level block diagram of QA Chip

FIG. 28 shows an analogue unit

FIG. 29 shows a serial bus protocol for trimming

FIG. 30 shows a block diagram of a trim unit

FIG. 31 shows a block diagram of a CPU of the QA chip

FIG. 32 shows block diagram of an MIU

FIG. 33 shows a block diagram of memory components

FIG. 34 shows a first byte sent to an IOU

FIG. 35 shows a block diagram of the IOU

FIG. 36 shows a relationship between external SDa and SClk and generation of internal signals

FIG. 37 shows block diagram of ALU

FIG. 38 shows a block diagram of DataSel

FIG. 39 shows a block diagram of ROR

FIG. 40 shows a block diagram of the ALU's IO block

FIG. 41 shows a block diagram of PCU

FIG. 42 shows a block diagram of an Address Generator Unit

FIG. 43 shows a block diagram for a Counter Unit

FIG. 44 shows a block diagram of PMU

FIG. 45 shows a state machine for PMU

FIG. 46 shows a block diagram of MRU

FIG. 47 shows simplified MAU state machine

FIG. 48 shows power-on reset behaviour

FIG. 49 shows a ring oscillator block diagram

FIG. 50 shows a system clock duty cycle

DETAILED DESCRIPTION OF EMBODIMENTS

The preferred of the present invention is implemented in a printer using microelectromechanical systems (MEMS) printheads. The printer can receive data from, for example, a personal computer such as an IBM compatible PC or Apple computer. In other embodiments, the printer can receive data directly from, for example, a digital still or video camera. The particular choice of communication link is not important, and can be based, for example, on USB, Firewire, Bluetooth or any other wireless or hardwired communications protocol.

A SoPEC (Small office home office Print Engine Controller) ASIC (Application Specific Integrated Circuit) suitable for use in, for example, SoHo printer products is described. The SoPEC ASIC is intended to be a low cost solution for bi-lithic printhead control, replacing the multichip solutions in larger more professional systems with a single chip. The increased cost competitiveness is achieved by integrating several systems such as a modified PEC1 printing pipeline, CPU control system, peripherals and memory sub-system onto one SoC ASIC, reducing component count and simplifying board design. In particular, application to Memjet printing systems is described, including bi-lithic printhead systems,

A bi-lithic based printhead is constructed from 2 printhead ICs of varying sizes. The notation M:N is used to express the size relationship of each IC, where M specifies one printhead IC in inches and N specifies the remaining printhead IC in inches.

A bi-lithic printhead produces 1600 dpi bi-level dots. On low-diffusion paper, each ejected drop forms a 22.5 m diameter dot. Dots are easily produced in isolation, allowing dispersed-dot dithering to be exploited to its fullest. Since the bi-lithic printhead is the width of the page and operates with a constant paper velocity, color planes are printed in perfect registration, allowing ideal dot-on-dot printing. Dot-on-dot printing minimizes ‘muddying’ of midtones caused by inter-color bleed.

A page layout may contain a mixture of images, graphics and text. Continuous-tone (contone) images and graphics are reproduced using a stochastic dispersed-dot dither. Unlike a clustered-dot (or amplitude-modulated) dither, a dispersed-dot (or frequency-modulated) dither reproduces high spatial frequencies (i.e. image detail) almost to the limits of the dot resolution, while simultaneously reproducing lower spatial frequencies to their full color depth, when spatially integrated by the eye. A stochastic dither matrix is carefully designed to be free of objectionable low-frequency patterns when tiled across the image. As such its size typically exceeds the minimum size required to support a particular number of intensity levels (e.g. 16×16×8 bits for 257 intensity levels).

Human contrast sensitivity peaks at a spatial frequency of about 3 cycles per degree of visual field and then falls off logarithmically, decreasing by a factor of 100 beyond about 40 cycles per degree and becoming immeasurable beyond 60 cycles per degree. At a normal viewing distance of 12 inches (about 300 mm), this translates roughly to 200-300 cycles per inch (cpi) on the printed page, or 400-600 samples per inch according to Nyquist's theorem.

In practice, contone resolution above about 300 ppi is of limited utility outside special applications such as medical imaging. Offset printing of magazines, for example, uses contone resolutions in the range 150 to 300 ppi. Higher resolutions contribute slightly to color error through the dither.

Black text and graphics are reproduced directly using bi-level black dots, and are therefore not anti-aliased (i.e. low-pass filtered) before being printed. Text should therefore be supersampled beyond the perceptual limits discussed above, to produce smoother edges when spatially integrated by the eye. Text resolution up to about 1200 dpi continues to contribute to perceived text sharpness (assuming low-diffusion paper, of course).

A Netpage printer, for example, may use a contone resolution of 267 ppi (i.e. 1600 dpĩ 6), and a black text and graphics resolution of 800 dpi. A high end office or departmental printer may use a contone resolution of 320 ppi (1600 dpi/5) and a black text and graphics resolution of 1600 dpi. Both formats are capable of exceeding the quality of commercial (offset) printing and photographic reproduction.

The SoPEC device can be used in several printer configurations and architectures. In the general sense every SoPEC based printer architecture will contain:

-   -   One or more SoPEC devices.     -   One or more bi-lithic printheads.     -   Two or more LSS busses.     -   Two or more QA chips.     -   USB 1.1 connection to host or ISI connection to Bridge Chip.     -   ISI bus connection between SoPECs (when multiple SoPECs are         used).

The printhead is constructed by abutting 2 printhead ICs together. The printhead ICs can vary in size from 2 inches to 8 inches, so to produce an A4 printhead several combinations are possible. For example two printhead ICs of 7 inches and 3 inches could be used to create a A4 printhead (the notation is 7:3). Similarly 6 and 4 combination (6:4), or 5:5 combination. For an A3 printhead it can be constructed from 8:6 or an 7:7 printhead IC combination. For photographic printing smaller printheads can be constructed.

Each SoPEC system can have several QA devices. Normally each printing SoPEC will have an associated PRINTER_QA. Ink cartridges will contain an INK_QA chip. PRINTER_QA and INK_QA devices should be on separate LSS busses. All QA chips in the system are physically identical with flash memory contents defining PRINTER_QA from INK_QA chip.

Several possible SoPEC based system architectures are now described. It is possible to have extra SoPEC devices in the system used for DRAM storage. The QA chip configurations shown are indicative of the flexibility of LSS bus architecture, but not limited to those configurations.

In FIG. 1, a single SoPEC device can be used to control two printhead ICs. The SoPEC receives compressed data through the USB device from the host. The compressed data is processed and transferred to the printhead.

In FIG. 2, two SoPEC devices are used to control two bi-lithic printheads, each with two printhead ICs. Each bi-lithic printhead prints to opposite sides of the same page to achieve duplex printing. The SoPEC connected to the USB is the ISIMaster SoPEC, the remaining SoPEC is an ISISlave. The ISIMaster receives all the compressed page data for both SoPECs and re-distributes the compressed data over the Inter-SoPEC Interface (ISI) bus.

It may not be possible to print an A4 page every 2 seconds in this configuration since the USB 1.1 connection to the host may not have enough bandwidth. An alternative would be for each SoPEC to have its own USB 1.1 connection. This would allow a faster average print speed.

In FIG. 3, two SoPEC devices are used to control one A3 bi-lithic printhead. Each SoPEC controls only one printhead IC (the remaining PHI port typically remains idle). This system uses the SoPEC with the USB connection as the ISIMaster. In this dual SoPEC configuration the compressed page store data is split across 2 SoPECs giving a total of 4 Mbyte page store, this allows the system to use compression rates as in an A4 architecture, but with the increased page size of A3. The ISIMaster receives all the compressed page data for all SoPECs and re-distributes the compressed data over the Inter-SoPEC Interface (ISI) bus.

It may not be possible to print an A3 page every 2 seconds in this configuration since the USB 1.1 connection to the host will only have enough bandwidth to supply 2 Mbytes every 2 seconds. Pages which require more than 2 MBytes every 2 seconds will therefore print more slowly. An alternative would be for each SoPEC to have its own USB 1.1 connection. This would allow a faster average print speed.

In FIG. 4 a 4 SoPEC system is shown. It contains 2 A3 bi-lithic printheads, one for each side of an A3 page. Each printhead contain 2 printhead ICs, each printhead IC is controlled by an independent SoPEC device, with the remaining PHI port typically unused. Again the SoPEC with USB 1.1 connection is the ISIMaster with the other SoPECs as ISISlaves. In total, the system contains 8 Mbytes of compressed page store (2 Mbytes per SOPEC), so the increased page size does not degrade the system print quality, from that of an A4 simplex printer. The ISIMaster receives all the compressed page data for all SoPECs and re-distributes the compressed data over the Inter-SoPEC Interface (ISI) bus.

It may not be possible to print an A3 page every 2 seconds in this configuration since the USB 1.1 connection to the host will only have enough bandwidth to supply 2 Mbytes every 2 seconds. Pages which require more than 2 MBytes every 2 seconds will therefore print more slowly. An alternative would be for each SoPEC or set of SoPECs on the same side of the page to have their own USB 1.1 connection (as ISISlaves may also have direct USB connections to the host). This would allow a faster average print speed.

Extra SoPECs can be used for DRAM storage e.g. in FIG. 5 an A4 simplex printer can be built with a single extra SoPEC used for DRAM storage. The DRAM SoPEC can provide guaranteed bandwidth delivery of data to the printing SoPEC. SoPEC configurations can have multiple extra SoPECs used for DRAM storage.

In FIG. 6, an ISI-Bridge chip provides slave-only ISI connections to SoPEC devices. FIG. 6 shows a ISI-Bridge chip with 2 separate ISI ports. The ISI-Bridge chip is the ISIMaster on each of the ISI busses it is connected to. All connected SoPECs are ISISlaves. The ISI-Bridge chip will typically have a high bandwidth connection to a host and may have an attached external DRAM for compressed page storage.

An alternative to having a ISI-Bridge chip would be for each SoPEC or each set of SoPECs on the same side of a page to have their own USB 1.1 connection. This would allow a faster average print speed.

The SoPEC is a page rendering engine ASIC that takes compressed page images as input, and produces decompressed page images at up to 6 channels of bi-level dot data as output. The bi-level dot data is generated for the Memjet bi-lithic printhead. The dot generation process takes account of printhead construction, dead nozzles, and allows for fixative generation.

A single SoPEC can control 2 bi-lithic printheads and up to 6 color channels at 10,000 lines/sec¹, equating to 30 pages per minute. A single SoPEC can perform full-bleed printing of A3, A4 and Letter pages. The 6 channels of colored ink are the expected maximum in a consumer SOHO, or office Bi-lithic printing environment:

-   -   CMY, for regular color printing.     -   K, for black text, line graphics and gray-scale printing.     -   IR (infrared), for Netpage-enabled [5] applications.     -   F (fixative), to enable printing at high speed. Because the         bi-lithic printer is capable of printing so fast, a fixative may         be required to enable the ink to dry before the page touches the         page already printed. Otherwise the pages may bleed on each         other. In low speed printing environments the fixative may not         be required. ¹10,000 lines per second equates to 30 A4/Letter         pages per minute at 1600 dpi

SoPEC is color space agnostic. Although it can accept contone data as CMYX or RGBX, where X is an optional 4th channel, it also can accept contone data in any print color space. Additionally, SoPEC provides a mechanism for arbitrary mapping of input 110,000 lines per second equates to 30 A4/Letter pages per minute at 1600 dpi channels to output channels, including combining dots for ink optimization, generation of channels based on any number of other channels etc. However, inputs are typically CMYK for contone input, K for the bi-level input, and the optional Netpage tag dots are typically rendered to an infra-red layer. A fixative channel is typically generated for fast printing applications.

SoPEC is resolution agnostic. It merely provides a mapping between input resolutions and output resolutions by means of scale factors. The expected output resolution is 1600 dpi, but SoPEC actually has no knowledge of the physical resolution of the Bi-lithic printhead.

SoPEC is page-length agnostic. Successive pages are typically split into bands and downloaded into the page store as each band of information is consumed and becomes free.

SoPEC provides an interface for synchronization with other SoPECs. This allows simple multi-SoPEC solutions for simultaneous A3/A4/Letter duplex printing. However, SoPEC is also capable of printing only a portion of a page image. Combining synchronization functionality with partial page rendering allows multiple SoPECs to be readily combined for alternative printing requirements including simultaneous duplex printing and wide format printing.

The required printing rate for SoPEC is 30 sheets per minute with an inter-sheet spacing of 4 cm. To achieve a 30 sheets per minute print rate, this requires:

300 mm×63 (dot/mm)/2 sec=105.8 seconds per line, with no inter-sheet gap.

340 mm×63 (dot/mm)/2 sec=93.3 seconds per line, with a 4 cm inter-sheet gap.

A printline for an A4 page consists of 13824 nozzles across the page [2]. At a system clock rate of 160 MHz 13824 dots of data can be generated in 86.4 seconds. Therefore data can be generated fast enough to meet the printing speed requirement. It is necessary to deliver this print data to the print-heads.

Printheads can be made up of 5:5, 6:4, 7:3 and 8:2 inch printhead combinations [2]. Print data is transferred to both print heads in a pair simultaneously. This means the longest time to print a line is determined by the time to transfer print data to the longest print segment. There are 9744 nozzles across a 7 inch printhead. The print data is transferred to the printhead at a rate of 106 MHz (⅔ of the system clock rate) per color plane. This means that it will take 91.9 s to transfer a single line for a 7:3 printhead configuration. So we can meet the requirement of 30 sheets per minute printing with a 4 cm gap with a 7:3 printhead combination. There are 11160 across an 8 inch printhead. To transfer the data to the printhead at 106 MHz will take 105.3 s. So an 8:2 printhead combination printing with an inter-sheet gap will print slower than 30 sheets per minute.

From the highest point of view the SoPEC device consists of 3 distinct subsystems

-   -   CPU Subsystem     -   DRAM Subsystem     -   Print Engine Pipeline (PEP) Subsystem

See FIG. 11 for a block level diagram of SoPEC.

The CPU subsystem controls and configures all aspects of the other subsystems. It provides general support for interfacing and synchronising the external printer with the internal print engine. It also controls the low speed communication to the QA chips. The CPU subsystem contains various peripherals to aid the CPU, such as GPIO (includes motor control), interrupt controller, LSS Master and general timers. The Serial Communications Block (SCB) on the CPU subsystem provides a full speed USB1.1 interface to the host as well as an Inter SoPEC Interface (ISI) to other SoPEC devices. Security SoPEC use cases are now described. Use cases for both single and multi-SoPEC systems are outlined. Some tasks may be composed of a number of sub-tasks. Communication between SoPEC and the QA chips (i.e. INK_QA and PRINTER_QA) will take place on at least a per power cycle and per page basis. Communication with the QA chips has three principal purposes: validating the presence of genuine QA chips (i.e the printer is using approved consumables), validation of the amount of ink remaining in the cartridge and authenticating the operating parameters for the printer. After each page has been printed, SoPEC is expected to communicate the number of dots fired per ink plane to the QA chipset. SoPEC may also initiate decoy communications with the QA chips from time to time.

Process:

-   -   When validating ink consumption SoPEC is expected to principally         act as a conduit between the PRINTER_QA and INK_QA chips and to         take certain actions (basically enable or disable printing and         report status to host PC) based on the result. The communication         channels are insecure but all traffic is signed to guarantee         authenticity.

Known Weaknesses

-   -   All communication to the QA chips is over the LSS interfaces         using a serial communication protocol. This is open to         observation and so the communication protocol could be reverse         engineered. In this case both the PRINTER_QA and INK_QA chips         could be replaced by impostor devices (e.g. a single FPGA) that         successfully emulated the communication protocol. As this would         require physical modification of each printer this is considered         to be an acceptably low risk. Any messages that are not signed         by one of the symmetric keys (such as the SoPEC_id key) could be         reverse engineered. The imposter device must also have access to         the appropriate keys to crack the system.     -   If the secret keys in the QA chips are exposed or cracked then         the system, or parts of it, is compromised.

Assumptions:

[1] The QA chips are not involved in the authentication of downloaded SoPEC code [2] The QA chip in the ink cartridge (INK_QA) does not directly affect the operation of the cartridge in any way i.e. it does not inhibit the flow of ink etc. [3] The INK_QA and PRINTER_QA chips are identical in their virgin state. They only become a INK_QA or PRINTER_QA after their FlashROM has been programmed.

The process is as follows:

-   1) SoPEC identification by activity on USB end-points 2-4 indicates     it is the ISIMaster (unless the SoPEC CPU has explicitly disabled     this function). -   2) The program is downloaded to the embedded DRAM. -   3) The CPU calculates a SHA-1 hash digest of the downloaded program. -   4) The ResetSrc register in the CPR block is read to determine     whether or not a power-on reset occurred. -   5) If a power-on reset occurred the signature of the downloaded code     (which needs to be in a known location such as the first or last N     bytes of the downloaded code) is decrypted using the Silverbrook     public boot0key stored in ROM. This decrypted signature is the     expected SHA-1 hash of the accompanying program. The encryption     algorithm is likely to be a public key algorithm such as RSA. If a     power-on reset did not occur then the expected SHA-1 hash is     retrieved from the PSS and the compute intensive decryption is not     required. -   6) The calculated and expected hash values are compared and if they     match then the programs authenticity has been verified. -   7) If the hash values do not match then the host PC is notified of     the failure and the SoPEC will await a new program download. -   8) If the hash values match then the CPU starts executing the     downloaded program. -   9) If, as is very likely, the downloaded program wishes to download     subsequent programs (such as OEM code) it is responsible for     ensuring the authenticity of everything it downloads. The downloaded     program may contain public keys that are used to authenticate     subsequent downloads, thus forming a hierarchy of authentication.     The SoPEC ROM does not control these authentications—it is solely     concerned with verifying that the first program downloaded has come     from a trusted source. -   10) At some subsequent point OEM code starts executing. The     Silverbrook supervisor code acts as an O/S to the OEM user mode     code. The OEM code must access most SoPEC functionality via system     calls to the Silverbrook code. -   11) The OEM code is expected to perform some simple ‘turn on the     lights’ tasks after which the host PC is informed that the printer     is ready to print and the Start Printing use case comes into play.

Known Weaknesses:

-   -   If the Silverbrook private boot0key is exposed or cracked then         the system is seriously compromised. A ROM mask change would be         required to reprogram the boot0key.

For authentication of download code in a multi-SoPEC system, an ISIMastrer SoPEC process includes:

-   1) SoPEC identification by activity on USB end-points 2-4 indicates     it is the ISIMaster. -   2) The SCB is configured to broadcast the data received from the     host PC. -   3) The program is downloaded to the embedded DRAM and broadcasted to     all ISISlave SoPECs over the ISI. -   4) The CPU calculates a SHA-1 hash digest of the downloaded program. -   5) The ResetSrc register in the CPR block is read to determine     whether or not a power-on reset occurred. -   6) If a power-on reset occurred the signature of the downloaded code     (which needs to be in a known location such as the first or last N     bytes of the downloaded code) is decrypted using the Silverbrook     public boot0key stored in ROM. This decrypted signature is the     expected SHA-1 hash of the accompanying program. The encryption     algorithm is likely to be a public key algorithm such as RSA. If a     power-on reset did not occur then the expected SHA-1 hash is     retrieved from the PSS and the compute intensive decryption is not     required. -   7) The calculated and expected hash values are compared and if they     match then the programs authenticity has been verified. -   8) If the hash values do not match then the host PC is notified of     the failure and the SoPEC will await a new program download. -   9) If the hash values match then the CPU starts executing the     downloaded program. -   10) It is likely that the downloaded program will poll each ISISlave     SoPEC for the result of its authentication process and to determine     the number of slaves present and their ISIIds. -   11) If any ISISlave SoPEC reports a failed authentication then the     ISIMaster communicates this to the host PC and the SoPEC will await     a new program download. -   12) If all ISISlaves report successful authentication then the     downloaded program is responsible for the downloading,     authentication and distribution of subsequent programs within the     multi-SoPEC system. -   13) At some subsequent point OEM code starts executing. The     Silverbrook supervisor code acts as an O/S to the OEM user mode     code. The OEM code must access most SoPEC functionality via system     calls to the Silverbrook code. -   14) The OEM code is expected to perform some simple ‘turn on the     lights’ tasks after which the master SoPEC determines that all     SoPECs are ready to print. The host PC is informed that the printer     is ready to print and the Start Printing use case comes into play.

While, an ISISlave SoPEC process includes:

-   1) When the CPU comes out of reset the SCB will be in slave mode,     and the SCB is already configured to receive data from both the ISI     and USB. -   2) The program is downloaded (via ISI or USB) to embedded DRAM. -   3) The CPU calculates a SHA-1 hash digest of the downloaded program. -   4) The ResetSrc register in the CPR block is read to determine     whether or not a power-on reset occurred. -   5) If a power-on reset occurred the signature of the downloaded code     (which needs to be in a known location such as the first or last N     bytes of the downloaded code) is decrypted using the Silverbrook     public boot0key stored in ROM. This decrypted signature is the     expected SHA-1 hash of the accompanying program. The encryption     algorithm is likely to be a public key algorithm such as RSA. If a     power-on reset did not occur then the expected SHA-1 hash is     retrieved from the PSS and the compute intensive decryption is not     required. -   6) The calculated and expected hash values are compared and if they     match then the programs authenticity has been verified. -   7) If the hash values do not match, then the ISISlave device will     await a new program again -   8) If the hash values match then the CPU starts executing the     downloaded program. -   9) It is likely that the downloaded program will communicate the     result of its authentication process to the ISIMaster. The     downloaded program is responsible for determining the SoPECs ISIId,     receiving and authenticating any subsequent programs. -   10) At some subsequent point OEM code starts executing. The     Silverbrook supervisor code acts as an O/S to the OEM user mode     code. The OEM code must access most SoPEC functionality via system     calls to the Silverbrook code. -   11) The OEM code is expected to perform some simple ‘turn on the     lights’ tasks after which the master SoPEC is informed that this     slave is ready to print. The Start Printing use case then comes into     play.

Known Weaknesses

-   -   If the Silverbrook private boot0key is exposed or cracked then         the system is seriously compromised.     -   ISI is an open interface i.e. messages sent over the ISI are in         the clear. The communication channels are insecure but all         traffic is signed to guarantee authenticity. As all         communication over the ISI is controlled by Supervisor code on         both the ISIMaster and ISISlave then this also provides some         protection against software attacks.

The SoPEC IC will be used in a range of printers with different capabilities (e.g. A3/A4 printing, printing speed, resolution etc.). It is expected that some printers will also have a software upgrade capability which would allow a user to purchase a license that enables an upgrade in their printer's capabilities (such as print speed). To facilitate this it must be possible to securely store the operating parameters in the PRINTER_QA chip, to securely communicate these parameters to the SoPEC and to securely reprogram the parameters in the event of an upgrade. Note that each printing SoPEC (as opposed to a SoPEC that is only used for the storage of data) will have its own PRINTER_QA chip (or at least access to a PRINTER_QA that contains the SoPEC's SoPEC_id_key). Therefore both ISIMaster and ISISlave SoPECs will need to authenticate operating parameters.

Process:

-   1) Program code is downloaded and authenticated. -   2) The program code has a function to create the SoPEC_id key from     the unique SoPEC_id that was programmed when the SoPEC was     manufactured. -   3) The SoPEC retrieves the signed operating parameters from its     PRINTER_QA chip. The PRINTER_QA chip uses the SoPEC_id_key (which is     stored as part of the pairing process executed during printhead     assembly manufacture & test) to sign the operating parameters which     are appended with a random number to thwart replay attacks. -   4) The SoPEC checks the signature of the operating parameters using     its SoPEC_id_key. If this signature authentication process is     successful then the operating parameters are considered valid and     the overall boot process continues. If not the error is reported to     the host PC. -   5) Operating parameters may also be set or upgraded using a second     key, the PrintEngineLicense_key, which is stored on the PRINTER_QA     and used to authenticate the change in operating parameters.

Known Weaknesses:

-   -   It may be possible to retrieve the unique SoPEC_id by placing         the SoPEC in test mode and scanning it out. It is certainly         possible to obtain it by reverse engineering the device. Either         way the SoPEC_id (and by extension the SoPEC_id_key) so obtained         is valid only for that specific SoPEC and so printers may only         be compromised one at a time by parties with the appropriate         specialised equipment. Furthermore even if the SoPEC_id is         compromised, the other keys in the system, which protect the         authentication of consumables and of program code, are         unaffected.

The CPU block consists of the CPU core, MMU, cache and associated logic. The principal tasks for the program running on the CPU to fulfill in the system are:

Communications:

-   -   Control the flow of data from the USB interface to the DRAM and         ISI     -   Communication with the host via USB or ISI     -   Running the USB device driver

PEP Subsystem Control:

-   -   Page and band header processing (may possibly be performed on         host PC)     -   Configure printing options on a per band, per page, per job or         per power cycle basis     -   Initiate page printing operation in the PEP subsystem     -   Retrieve dead nozzle information from the printhead interface         (PHI) and forward to the host PC     -   Select the appropriate firing pulse profile from a set of         predefined profiles based on the printhead characteristics     -   Retrieve printhead temperature via the PHI

Security:

-   -   Authenticate downloaded program code     -   Authenticate printer operating parameters     -   Authenticate consumables via the PRINTER_QA and INK_QA chips     -   Monitor ink usage     -   Isolation of OEM code from direct access to the system resources

Other:

-   -   Drive the printer motors using the GPIO pins     -   Monitoring the status of the printer (paper jam, tray empty         etc.)     -   Driving front panel LEDs     -   Perform post-boot initialisation of the SoPEC device     -   Memory management (likely to be in conjunction with the host PC)     -   Miscellaneous housekeeping tasks

To control the Print Engine Pipeline the CPU is required to provide a level of performance at least equivalent to a 16-bit Hitachi H8-3664 microcontroller running at 16 MHz. An as yet undetermined amount of additional CPU performance is needed to perform the other tasks, as well as to provide the potential for such activity as Netpage page assembly and processing, RIPing etc. The extra performance required is dominated by the signature verification task and the SCB (including the USB) management task. An operating system is not required at present. A number of CPU cores have been evaluated and the LEON P1754 is considered to be the most appropriate solution. A diagram of the CPU block is shown in FIG. 13.

A number of hardware, software and protocol solutions to security issues have been developed. These range from authorization and encryption protocols for enabling secure communication between hardware and software modules, to physical and electrical systems that protect the integrity of integrated circuits and other hardware.

It should be understood that in many cases, principles described with reference to hardware such as integrated circuits (ie, chips) can be implemented wholly or partly in software running on, for example, a computer. Mixed systems in which software and hardware (and combinations) embody various entities, modules and units can also be constructed using may of these principles, particularly in relation to authorization and authentication protocols. The particular extent to which the principles described below can be translated to or from hardware or software will be apparent to one skilled in the art, and so will not always explicitly be explained.

It should also be understood that many of the techniques disclosed below have application to many fields other than printing. Some specific examples are described towards the end of this description.

A “QA Chip” is a quality assurance chip can allows certain security functions and protocols to be implemented. The preferred QA Chip is described in some detail later in this specification.

Any given physical QA Chip will contain functionality that allows it to operate as an entity in some number of these protocols. Therefore, wherever the terms ChipR, ChipT, ChipP, ChipF, ChipU and ChipS are used, they are referring to logical entities involved in an authentication protocol.

Physical QA Chips are referred to by their location. For example, each ink cartridge may contain a QA Chip referred to as an INK_QA, with all INK_QA chips being on the same physical bus. In the same way, the QA Chip inside the printer is referred to as PRINTER_QA, and will be on a separate bus to the INK_QA chips.

When applied to a printing environment, the functional security requirements for the preferred embodiment are:

-   -   Code of QA chip owner or licensee co-existing safely with code         of authorized OEMs     -   Chip owner/licensee operating parameters authentication     -   Parameters authentication for authorized OEMs     -   Ink usage authentication

The authentication requirements imply that:

-   -   OEMs and end-users must not be able to replace or tamper with QA         chip manufacturer/owner's program code or data     -   OEMs and end-users must not be able to perform unauthorized         activities for example by calling chip manufacturer/owner's code     -   End-users must not be able to replace or tamper with OEM program         code or data     -   End-users must not be able to call unauthorized functions within         OEM program code     -   Manufacturer/owner's development program code must not be         capable of running on all SoPECs.     -   OEMs must be able to test products at their highest upgradable         status, yet not be able to ship them outside the terms of their         license     -   OEMs and end-users must not be able to directly access the print         engine pipeline (PEP) hardware, the LSS Master (for QA Chip         access) or any other peripheral block with the exception of         operating system permitted GPIO pins and timers.

SoPEC includes a CPU that must run both manufacturer/owner program code and OEM program code. The execution model envisaged for SoPEC is one where Manufacturer/owner program code forms an operating system (O/S), providing services such as controlling the print engine pipeline, interfaces to communications channels etc. The OEM program code must run in a form of user mode, protected from harming the Manufacturer/owner program code. The OEM program code is permitted to obtain services by calling functions in the O/S, and the O/S may also call OEM code at specific times. For example, the OEM program code may request that the O/S call an OEM interrupt service routine when a particular GPIO pin is activated.

In addition, we may wish to permit the OEM code to directly call functions in Manufacturer/owner code with the same permissions as the OEM code. For example, the Manufacturer/owner code may provide SHA1 as a service, and the OEM could call the SHA1 function, but execute that function with OEM permissions and not Silverbook permissions.

A basic requirement then, for SoPEC, is a form of protection management, whereby Manufacturer/owner and OEM program code can co-exist without the OEM program code damaging operations or services provided by the Manufacturer/owner O/S. Since services rely on SoPEC peripherals (such as USB2 Host, LSS Master, Timers etc) access to these peripherals should also be restricted to Manufacturer/owner program code only. A particular OEM will be licensed to run a Print Engine with a particular set of operating parameters (such as print speed or quality). The OEM and/or end-user can upgrade the operating license for a fee and thereby obtain an upgraded set of operating parameters. Neither the OEM nor end-user should be able to upgrade the operating parameters without paying the appropriate fee to upgrade the license. Similarly, neither the OEM nor end-user should be able to bypass the authentication mechanism via any program code on SoPEC. This implies that OEMs and end-users must not be able to tamper with or replace Manufacturer/owner program code or data, nor be able to call unauthorized functions within Manufacturer/owner program code.

However, the OEM must be capable of assembly-line testing the Print Engine at the upgraded status before selling the Print Engine to the end-user.

The OEM may provide operating parameters to the end-user independent of the Manufacturer/owner operating parameters. For example, the OEM may want to sell a franking machine². ²a franking machine prints stamps

The end-user should not be able to upgrade the operating parameters without paying the appropriate fee to the OEM. Similarly, the end-user should not be able to bypass the authentication mechanism via any program code on SoPEC. This implies that end-users must not be able to tamper with or replace OEM program code or data, as well as not be able to tamper with the PEP blocks or service-related peripherals.

If an end user takes the time and energy to hack the print engine and thereby succeeds in upgrading the single print engine only, yet not be able to use the same keys etc on another print engine, that is an acceptable security compromise. However it doesn't mean we have to make it totally simple or cheap for the end-user to accomplish this.

Software-only attacks are the most dangerous, since they can be transmitted via the internet and have no perceived cost. Physical modification attacks are far less problematic, since most printer users are not likely to want their print engine to be physically modified. This is even more true if the cost of the physical modification is likely to exceed the price of a legitimate upgrade.

Any solution to the above requirements should also meet certain preferred implementation constraints. These are:

-   -   No flash memory inside SoPEC     -   SoPEC must be simple to verify     -   Manufacturer/owner program code must be updateable     -   OEM program code must be updateable     -   Must be bootable from activity on USB2     -   Must be bootable from an external ROM to allow stand-alone         printer operation     -   No extra pins for assigning IDs to slave SoPECs     -   Cannot trust the comms channel to the QA Chip in the printer         (PRINTER_QA)     -   Cannot trust the comms channel to the QA Chip in the ink         cartridges (INK_QA)     -   Cannot trust the USB comms channel

These constraints are detailed below.

The preferred embodiment of SoPEC is intended to be implemented in 0.13 micron or smaller. Flash memory will not be available in any of the target processes being considered.

All combinatorial logic and embedded program code within SoPEC must be verified before manufacture. Every increase in complexity in either of these increases verification effort and increases risk.

It is neither possible nor desirable to write a single complete operating system that is:

-   -   verified completely     -   correct for all possible future uses of SoPEC systems     -   finished in time for SoPEC manufacture

Therefore the complete Manufacturer/owner program code must not permanently reside on SoPEC. It must be possible to update the Manufacturer/owner program code as enhancements to functionality are made and bug fixes are applied.

In the worst case, only new printers would receive the new functionality or bug fixes. In the best case, existing SoPEC users can download new embedded code to enable functionality or bug fixes. Ideally, these same users would be obtaining these updates from the OEM website or equivalent, and not require any interaction with Manufacturer/owner.

Given that each OEM will be writing specific program code for printers that have not yet been conceived, it is impossible for all OEM program code to be embedded in SoPEC at the ASIC manufacture stage.

Since flash memory is not available, OEMs cannot store their program code in on-chip flash. While it is theoretically possible to store OEM program code in ROM on SoPEC, this would entail OEM-specific ASICs which would be prohibitively expensive.

Therefore OEM program code cannot permanently reside on SoPEC.

Since OEM program code must be downloadable for SoPEC to execute, it should therefore be possible to update the OEM program code as enhancements to functionality are made and bug fixes are applied.

In the worst case, only new printers would receive the new functionality or bug fixes. In the best case, existing SoPEC users can download new embedded code to enable functionality or bug fixes. Ideally, these same users would be obtaining these updates from the OEM website or equivalent, and not require any interaction with Manufacturer/owner.

SoPEC can be placed in sleep mode to save power when printing is not required. RAM is not preserved in sleep mode. Therefore any program code and data in RAM will be lost. However, SoPEC must be capable of being woken up by the host when it is time to print again.

In the case of a single SoPEC system, the host communicates with SoPEC via USB2. From SoPEC's point of view, it is activity on the USB2 device port that signals the time to wake up.

In the case of a multi-SoPEC system, the host typically communicates with the Master SoPEC chip (as above), and then the Master relays messages to other Slave SoPECs by sending data out USB2 host port(s) and into the Slave SoPEC's device port. The net result is that the Slave SoPECs and the Master SoPEC all boot as a result of activity on the USB2 device port.

Therefore SoPEC must be capable of being woken up by activity on the USB2 device port.

SoPEC must also support the case where the printer is not connected to a PC (or the PC is currently turned off), and a digital camera or equivalent is plugged into the SoPEC-based printer. In this case, the entire printing application needs to be present within the hardware of the printer.

Since the Manufacturer/owner program code and OEM program code will vary depending on the application, it is not possible to store the program in SoPEC's ROM.

Therefore SoPEC requires a means of booting from a non-PC host. It is possible that this could be accomplished by the OEM adding a USB2-host chip to the printer and simulating the effect of a PC, and thereby download the program code. This solution requires the boot operation to be based on USB2 activity. However this is an unattractive solution since it adds microprocessor complexity and component cost when only a ROM-equivalent was desired.

As a result SoPEC should ideally be able to boot from an external ROM of some kind. Note that booting from an external ROM means first booting from the internal ROM, and then downloading and authenticating the startup section of the program from the external ROM. This is not the same as simply running program code in-situ within an external ROM, since one of the security requirements was that OEMs and end-users must not be able to replace or tamper with Manufacturer/owner program code or data, i.e. we never want to blindly run code from an external ROM.

As an additional point, if SoPEC is in sleep mode, SoPEC must be capable of instigating the boot process due to activity on a programmable GPIO. e.g. a wake-up button. This would be in addition to the standard power-on booting.

In a single SoPEC system the host only sends data to the single SoPEC. However in a multi-SoPEC system, each of the slaves needs to be uniquely identifiable in order to be able for the host to send data to the correct slave.

Since there is no flash on board SoPEC we are unable to store a slave ID in each SoPEC. Moreover, any ROM in each SoPEC will be identical.

It is possible to assign n pins to allow 2^(n) combinations of IDs for slave SoPECs. However a design goal of SoPEC is to minimize pins for cost reasons, and this is particularly true of features only used in multi-SoPEC systems.

The design constraint requirement is therefore to allow slaves to be IDed via a method that does not require any extra pins. This implies that whatever boot mechanism that satisfies the security requirements must also be able to assign IDs to slave SoPECs.

If the printer operating parameters are stored in the non-volatile memory of the Print Engine's on-board PRINTER_QA chip, both Manufacturer/owner and OEM program code cannot rely on the communication channel being secure. It is possible for an attacker to eavesdrop on communications to the PRINTER_QA chip, replace the PRINTER_QA chip and/or subvert the communications channel. It is also possible for this to be true during manufacture of the circuit board containing the SoPEC and the PRINTER_QA chip.

The amount of ink remaining for a given ink cartridge is stored in the non-volatile memory of that ink cartridge's INK_QA chip. Both Manufacturer/owner and OEM program code cannot rely on the communication channel to the INK_QA being secure. It is possible for an attacker to eavesdrop on communications to the INK_QA chip, to replace the INK_QA chip and/or to subvert the communications channel. It is also possible for this to be true during manufacture of the consumable containing the INK_QA chip. In a multi-SoPEC system, or in a single-SoPEC system that has a non-USB2 connection to the host, a given SoPEC will receive its data over a USB2 host port. It is quite possible for an end-user to insert a chip that eavesdrops on and/or subverts the communications channel (for example performs man-in-the-middle attacks).

A proposed solution to the above requirements, can be summarised as:

-   -   Each SoPEC has a unique id     -   CPU with user/supervisor mode     -   Memory Management Unit     -   The unique id is not cached     -   Specific entry points in O/S     -   Boot procedure, including authentication of program code and         operating parameters     -   SoPEC physical identification

Each SoPEC needs to contains a unique SoPEC_id of minimum size 64-bits. This SoPEC_id is used to form a symmetric key unique to each SoPEC: SoPEC_id_key. On SoPEC we make use of an additional 112-bit ECID³ macro that has been programmed with a random number on a per-chip basis. Thus SoPEC_id is the 112-bit macro, and the SoPEC_id_key is a 160-bit result obtained by SHA1 (SoPEC_id). ³Electronic Chip Id

The verification of operating parameters and ink usage depends on SoPEC_id being difficult to determine. Difficult to determine means that someone should not be able to determine the id via software, or by viewing the communications between chips on the board. If the SoPEC_id is available through running a test procedure on specific test pins on the chip, then depending on the ease by which this can be done, it is likely to be acceptable. It is important to note that in the proposed solution, compromise of the SoPEC_id leads only to compromise of the operating parameters and ink usage on this particular SoPEC. It does not compromise any other SoPEC or all inks or operating parameters in general. It is ideal that the SoPEC_id be random, although this is unlikely to occur on standard manufacture processes for ASICs. If the id is within a small range however, it will be able to be broken by brute force. This is why 32-bits is not sufficient protection.

SoPEC contains a CPU with direct hardware support for user and supervisor modes. At present, the intended CPU is the LEON (a 32-bit processor with an instruction set according to the IEEE-1754 standard. The IEEE1754 standard is compatible with the SPARC V8 instruction set).

Manufacturer/owner (operating system) program code will run in supervisor mode, and all OEM program code will run in user mode.

SoPEC contains a Memory Management Unit (MMU) that limits access to regions of DRAM by defining read, write and execute access permissions for supervisor and user mode. Program code running in user mode is subject to user mode permission settings, and program code running in supervisor mode is subject to supervisor mode settings. A setting of 1 for a permission bit means that type of access (e.g. read, write, execute) is permitted. A setting of 0 for a read permission bit means that that type of access is not permitted.

At reset and whenever SoPEC wakes up, the settings for all the permission bits are 1 for all supervisor mode accesses, and 0 for all user mode accesses. This means that supervisor mode program code must explicitly set user mode access to be permitted on a section of DRAM.

Access permission to all the non-valid address space should be trapped, regardless of user or supervisor mode, and regardless of the access being read, execute, or write.

Access permission to all of the valid non-DRAM address space (for example the PEP blocks) is supervisor read/write access only (no supervisor execute access, and user mode has no acccess at all) with the exception that certain GPIO and Timer registers can also be accessed by user code. These registers will require bitwise access permissions. Each peripheral block will determine how the access is restricted.

With respect to the DRAM and PEP subsystems of SoPEC, typically we would set user read/write/execute mode permissions to be 1/1/0 only in the region of memory that is used for OEM program data, 1/0/1 for regions of OEM program code, and 0/0/0 elsewhere (including the trap table). By contrast we would typically set supervisor mode read/write/execute permissions for this memory to be 1/1/0 (to avoid accidentally executing user code in supervisor mode).

The SoPEC_id parameter should only be accessible in supervisor mode, and should only be stored and manipulated in a region of memory that has no user mode access.

The unique SoPEC_id needs to be available to supervisor code and not available to user code. This is taken care of by the MMU.

However the SoPEC_id must also not be accessible via the CPU's data cache or register windows. For example, if the user were to cause an interrupt to occur at a particular point in the program execution when the SoPEC_id was being manipulated, it must not be possible for the user program code to turn caching off and then access the SoPEC_id inside the data cache. This would bypass any MMU security.

The same must be true of register windows. It must not be possible for user mode program code to read or modify register settings in a supervisor program's register windows.

This means that at the least, the SoPEC_id itself must not be cacheable. Likewise, any processed form of the SoPEC_id such as the SoPEC_id_key (e.g. read into registers or calculated expected results from a QA_Chip) should not be accessible by user program code.

Given that user mode program code cannot even call functions in supervisor code space, the question arises as how OEM programs can access functions, or request services. The implementation for this depends on the CPU.

On the LEON processor, the TRAP instruction allows programs to switch between user and supervisor mode in a controlled way. The TRAP switches between user and supervisor register sets, and calls a specific entry point in the supervisor code space in supervisor mode. The TRAP handler dispatches the service request, and then returns to the caller in user mode.

Use of a command dispatcher allows the O/S to provide services that filter access—e.g. a generalised print function will set PEP registers appropriately and ensure QA Chip ink updates occur.

The LEON also allows supervisor mode code to call user mode code in user mode. There are a number of ways that this functionality can be implemented. It is possible to call the user code without a trap, but to return to supervisor mode requires a trap (and associated latency).

The intention is to load the Manufacturer/owner and OEM program code into SoPEC's RAM, where it can be subsequently executed. The basic SoPEC therefore, must be capable of downloading program code. However SoPEC must be able to guarantee that only authorized Manufacturer/owner boot programs can be loaded, otherwise anyone could modify the O/S to do anything, and then load that—thereby bypassing the licensed operating parameters.

We perform authentication of program code and data using asymmetric (public-key) digital signatures and without using a QA Chip.

Assuming we have already downloaded some data and a 160-bit signature into eDRAM, the boot loader needs to perform the following tasks:

-   -   perform SHA-1 on the downloaded data to calculate a digest         localDigest     -   perform asymmetric decryption on the downloaded signature         (160-bits) using an asymmetric public key to obtain         authorizedDigest     -   If authorizedDigest is the PKCS#1 (patent free) form of         localDigest, then the down-loaded data is authorized (the         signature must have been signed with the asymmetric private key)         and control can then be passed to the downloaded data

Asymmetric decryption is used instead of symmetric decryption because the decrypting key must be held in SoPEC's ROM. If symmetric private keys are used, the ROM can be probed and the security is compromised.

The procedure requires the following data item:

-   -   boot0key=an n-bit asymmetric public key

The procedure also requires the following two functions:

-   -   SHA-1=a function that performs SHA-1 on a range of memory and         returns a 160-bit digest     -   decrypt=a function that performs asymmetric decryption of a         message using the passed-in key         -   PKCS#1 form of localDigest is 2048-bits formatted as             follows: bits 2047-2040=0x00, bits 2039-2032=0x01, bits             2031-288=0xFF . . . 0xFF, bits             287-160=0x003021300906052BOE03021A05000414, bits             159-0=localDigest.

Assuming that all of these are available (e.g. in the boot ROM), boot loader 0 can be defined as in the following pseudocode:

   bootloader0(data, sig)     localDigest ← SHA-1(data)     authorizedDigest ← decrypt(sig, boot0key)     expectedDigest     =     0x00|0x01|0xFF..0xFF|       0x003021300906052B0E03021A05000414 |localDigest) // “|” = concat     If (authorizedDigest == expectedDigest)     jump to program code at data-start address// will never return     Else     // program code is unauthorized     EndIf

The length of the key will depend on the asymmetric algorithm chosen. The key must provide the equivalent protection of the entire QA Chip system—if the Manufacturer/owner O/S program code can be bypassed, then it is equivalent to the QA Chip keys being compromised. In fact it is worse because it would compromise Manufacturer/owner operating parameters, OEM operating parameters, and ink authentication by software downloaded off the net (e.g. from some hacker).

In the case of RSA, a 2048-bit key is required to match the 160-bit symmetric-key security of the QA Chip. In the case of ECDSA, a key length of 132 bits is likely to suffice. RSA is convenient because the patent (U.S. Pat. No. 4,405,829) expired in September 2000.

There is no advantage to storing multiple keys in SoPEC and having the external message choose which key to validate against, because a compromise of any key allows the external user to always select that key.

There is also no particular advantage to having the boot mechanism select the key (e.g. one for USB-based booting and one for external ROM booting) a compromise of the external ROM booting key is enough to compromise all the SoPEC systems. However, there are advantages in having multiple keys present in the boot ROM and having a wire-bonding option on the pads select which of the keys is to be used. Ideally, the pads would be connected within the package, and the selection is not available via external means once the die has been packaged. This means we can have different keys for different application areas (e.g. different uses of the chip), and if any particular SoPEC key is compromised, the die could be kept constant and only the bonding changed. Note that in the worst case of all keys being compromised, it may be economically feasible to change the boot0key value in SoPEC's ROM, since this is only a single mask change, and would be easy to verify and characterize.

Therefore the entire security of SoPEC is based on keeping the asymmetric private key paired to boot0key secure. The entire security of SoPEC is also based on keeping the program that signs (i.e. authorizes) datasets using the asymmetric private key paired to boot0key secure.

It may therefore be reasonable to have multiple signatures (and hence multiple signature programs) to reduce the chance of a single point of weakness by a rogue employee. Note that the authentication time increases linearly with the number of signatures, and requires a 2048-bit public key in ROM for each signature.

Given that test programs, evaluation programs, and Manufacturer/owner O/S code needs to be written and tested, and OEM program code etc. also needs to be tested, it is not secure to have a single authentication of a monolithic dataset combining Manufacturer/owner O/S, non-O/S, and OEM program code—we certainly don't want OEMs signing Manufacturer/owner program code, and Manufacturer/owner shouldn't have to be involved with the signing of OEM program code.

Therefore we require differing levels of authentication and therefore a number of keys, although the procedure for authentication is identical to the first—a section of program code contains the key and procedure for authenticating the next.

This method allows for any hierarchy of authentication, based on a root key of boot0key. For example, assume that we have the following entities:

-   -   QACo, Manufacturer/owner's QA/key company. Knows private version         of boot0key, and owner of security concerns.     -   SoPECCo, Manufacturer/owner's SoPEC hardware/software company.         Supplies SoPEC ASICs and SoPEC O/S printing software to a ComCo.     -   ComCo, a company that assembles Print Engines from SoPECs,         Memjet printheads etc, customizing the Print Engine for a given         OEM according to a license     -   OEM, a company that uses a Print Engine to create a printer         product to sell to the end-users. The OEM would supply the motor         control logic, user interface, and casing.

The levels of authentication hierarchy are as follows:

-   -   QACo writes the boot ROM, agenerates dataset1, consisting of a         boot loader program that loads and validates dataset2and QACo's         asymmetric public boot1key. QACo signs dataset0 with the         asymmetric private boot0key.     -   SoPECCo generates dataset1, consisting of the print engine         security kernel O/S (which incorporates the security-based         features of the print engine functionality) and the ComCo's         asymmetric public key. Upon a special “formal release” request         from SoPECCo, QACo signs dataset0 with QACo's asymmetric private         boot0key key. The print engine program code expects to see an         operating parameter block signed by the ComCo's asymmetric         private key. Note that this is a special “formal release”         request to by SoPECCo.

The ComCo generates dataSet3, consisting of dataset1 plus dataset2, where dataset2 is an operating parameter block for a given OEM's print engine license (according to the print engine license arrangement) signed with the ComCo's asymmetric private key. The operating parameter block (dataset2) would contain valid print speed ranges, a PrintEngineLicenseId, and the OEM's asymmetric public key. The ComCo can generate as many of these operating parameter blocks for any number of Print Engine Licenses, but cannot write or sign any supervisor O/S program code.

-   -   The OEM would generate dataset5, consisting of dataset3 plus         dataset4, where dataset4 is the OEM program code signed with the         OEM's asymmetric private key. The OEM can produce as many         versions of dataset5 as it likes (e.g. for testing purposes or         for updates to drivers etc) and need not involve         Manufacturer/owner, QACo, or ComCo in any way.

The relationship is shown in FIG. 19.

When the end-user uses dataset5, SoPEC itself validates dataset1 via the boot0key mechanism. Once dataset1 is executing, it validates dataset2, and uses dataset2 data to validate dataset4. The validation hierarchy is shown in FIG. 20.

If a key is compromised, it compromises all subsequent authorizations down the hierarchy. In the example from above (and as illustrated in FIG. 20) if the OEM's asymmetric private key is compromised, then O/S program code is not compromised since it is above OEM program code in the authentication hierarchy. However if the ComCo's asymmetric private key is compromised, then the OEM program code is also compromised. A compromise of boot0key compromises everything up to SoPEC itself, and would require a mask ROM change in SoPEC to fix.

It is worthwhile repeating that in any hierarchy the security of the entire hierarchy is based on keeping the asymmetric private key paired to boot0key secure. It is also a requirement that the program that signs (i.e. authorizes) datasets using the asymmetric private key paired to boot0key secure.

The hierarchical boot procedure described above gives a hierarchy of protection in a final shipped product.

It is also desirable to use a hierarchy of protection during software development within Manufacturer/owner.

For a program to be downloaded and run on SoPEC during development, it will need to be signed. In addition, we don't want to have to sign each and every Manufacturer/owner development code with the boot0key, as it creates the possibility of any developmental (including buggy or rogue) application being run on any SoPEC.

Therefore QACo needs to generate/create a special intermediate boot loader, signed with boot0key, that performs the exact same tasks as the normal boot loader, except that it checks the SoPECid to see if it is a specific SoPECid (or set of SoPECids). If the SoPEC_id is in the valid set, then the developmental boot loader validates dataset2 by means of its length and a SHA-1 digest of the developmental code⁴, and not by a further digital signature. The QACo can give this boot loader to the software development team within Manufacturer/owner. The software team can now write and run any program code, and load the program code using the development boot loader. There is no requirement for the subsequent software program (i.e. the developmental program code) to be signed with any key since the programs can only be run on the particular SoPECs. ⁴The SHA-1 digest is to allow the total program load time to simulate the running time of the normal boot loader running on a non-developmental version of the program.

If the developmental boot loader (and/or signature generator) were compromised, or any of the developmental programs were compromised, the worst situation is that an attacker could run programs on that particular set of SoPECs, and on no others.

This should greatly reduce the possibility of erroneous programs signed with boot0key being available to an attacker (only official releases are signed by boot0key), and therefore reduces the possibility of a Manufacturer/owner employee intentionally or inadvertently creating a back door for attackers.

The relationship is shown below in FIG. 21.

Theoretically the same kind of hierarchy could also be used to allow OEMs to be assured that their program code will only work on specific SoPECs, but this is unlikely to be necessary, and is probably undesirable.

It is possible that errors in supervisor program code (e.g. the operating system) could allow attackers to subvert the program in SoPEC and gain supervisor control.

To reduce the impact of this kind of attack, it is possible to allocate some bits of the SoPEC_id to form some kind of date. The granularity of the date could be as simple as a single bit that says the date is obtained from the regular IBM ECID, or it could be 6 bits that give 10 years worth of 3-month units.

The first step of the program loaded by boot loader 0 could check the SoPEC_id date, and run or refuse to run appropriately. The Manufacturer/owner driver or OS could therefore be limited to run on SoPECs that are manufactured up until a particular date.

This means that the OEM would require a new version of the OS for SoPECs after a particular date, but the new driver could be made to work on all previous versions of SoPEC. The function simply requires a form of date, whose granularity for working can be determined by agreement with the OEM.

For example, suppose that SoPECs are supplied with 3-month granularity in their date components. Manufacturer/owner could ship a version of the OS that works for any SoPEC of the date (i.e. on any chip), or for all SoPECs manufactured during the year etc. The driver issued the next year could work with all SoPECs up until that years etc. In this way the drivers for a chip will be backwards compatible, but will be deliberately not forwards-compatible. It allows the downloading of a new driver with no problems, but it protects against bugs in one years's driver OS from being used against future SoPECs. Note that the phasing in of a new OS doesn't have to be at the same time as the hardware. For example, the new OS can come in 3 months before the hardware that it supports. However once the new SoPECs are being delivered, the OEM must not ship the older driver with the newer SoPECs, for the old driver will not work on the newer SoPECs. Basically once the OEM has received the new driver, they should use that driver for all SoPEC systems from that point on (old SoPECs will work with the new driver). This date-limiting feature would most likely be using a field in the ComCo specified operating parameters, so it allows the SoPEC to use date-checking in addition to additional QA Chip related parameter checking (such as the OEM's PrintEngineLicenseId etc).

A variant on this theme is a date-window, where a start-date and end-date are specified (as relating to SoPEC manufacture, not date of use).

Operating parameters need to be considered in terms of Manufacturer/owner operating parameters and OEM operating parameters. Both sets of operating parameters are stored on the PRINTER_QA chip (physically located inside the printer). This allows the printer to maintain parameters regardless of being moved to different computers, or a loss/replacement of host O/S drivers etc.

On PRINTER_QA, memory vector M₀ contains the upgradable operating parameters, and memory vectors M₁₊ contains any constant (non-upgradable) operating parameters. Considering only Manufacturer/owner operating parameters for the moment, there are actually two problems:

-   a. setting and storing the Manufacturer/owner operating parameters,     which should be authorized only by Manufacturer/owner -   b. reading the parameters into SoPEC, which is an issue of SoPEC     authenticating the data on the PRINTER_QA chip since we don't trust     PRINTER_QA.

The PRINTER_QA chip therefore contains the following symmetric keys:

-   -   K₀=PrintEngineLicense_key. This key is constant for all SoPECs         supplied for a given print engine license agreement between an         OEM and a Manufacturer/owner ComCo. K₀ has write permissions to         the Manufacturer/owner upgradeable region of M₀ on PRINTER_QA.     -   K₁=SoPEC_id_key. This key is unique for each SoPEC, and is known         only to the SoPEC and PRINTER_QA. K₁ does not have write         permissions for anything.

K₀ is used to solve problem (a). It is only used to authenticate the actual upgrades of the operating parameters.

K₁ is used by SoPEC to solve problem (b). It is used to authenticate reads of data (i.e. the operating parameters) from PRINTER_QA.

Note that the procedure for verifying reads of data from PRINTER_QA does not rely on Manufacturer/owner's key K₀. This means that precisely the same mechanism can be used to read and authenticate the OEM data also stored in PRINTER_QA. Of course this must be done by Manufacturer/owner supervisor code so that SoPEC_id_key is not revealed. If the OEM also requires upgradable parameters, we can add an extra key to PRINTER_QA, where that key is an OEM_key and has write permissions to the OEM part of M₀.

In this way, K₁ never needs to be known by anyone except the SoPEC and PRINTER_QA.

Each printing SoPEC in a multi-SoPEC system need access to a PRINTER_QA chip that contains the appropriate SoPEC_id_key to validate ink useage and operating parameters. This can be accomplished by a separate PRINTER_QA for each SoPEC, or by adding extra keys (multiple SoPEC_id_keys) to a single PRINTER_QA.

However, if ink usage is not being validated (e.g. if print speed were the only Manufacturer/owner upgradable parameter) then not all SoPECs require access to a PRINTER_QA chip that contains the appropriate SoPEC_id_key. Assuming that OEM program code controls the physical motor speed (different motors per OEM), then the PHI within the first (or only) front-page SoPEC can be programmed to accept (or generate) line sync pulses no faster than a particular rate. If line syncs arrived faster than the particular rate, the PHI would simply print at the slower rate. If the motor speed was hacked to be fast, the print image will appear stretched.

Manufacturer/owner operating parameters include such items as print speed, print quality etc. and are tied to a license provided to an OEM. These parameters are under Manufacturer/owner control. The licensed Manufacturer/owner operating parameters are typically stored in the PRINTER_QA.

However there are situations when it is desirable to have a floating upgrade to a license, for use on a printer of the user's choice. For example, OEMs may sell a speed-increase license upgrade that can be plugged into the printer of the user's choice. This form of upgrade can be considered a floating upgrade in that it upgrades whichever printer it is currently plugged into. This dongle is referred to as ADDITIONAL_PRINTER_QA. The software checks for the existence of an ADDITIONAL_PRINTER_QA, and if present the operating parameters are chosen from the values stored on both QA chips.

The basic problem of authenticating the additional operating parameters boils down to the problem that we don't trust ADDITIONAL_PRINTER_QA. Therefore we need a system whereby a given SoPEC can perform an authenticated read of the data in ADDITIONAL_PRINTER_QA.

We should not write the SoPEC_id_key to a key in the ADDITIONAL_PRINTER_QA because:

-   -   then it will be tied specifically to that SoPEC, and the primary         intention of the ADDITIONAL_PRINTER_QA is that it be floatable;     -   the ink cartridge would then not work in another printer since         the other printer would not know the old SoPEC_id_key (knowledge         of the old key is required in order to change the old key to a         new one).     -   updating keys is not power-safe (i.e. if at the user's site,         power is removed mid-update, the ADDITIONAL_PRINTER_QA could be         rendered useless)

The proposed solution is to let ADDITIONAL_PRINTER_QA have two keys:

-   -   K₀=FloatingPrintEngineLicense_key. This key has the same         function as the PrintEngineLicense_key in the PRINTER_QA⁵ in         that K₀ has write permissions to the Manufacturer/owner         upgradeable region of M₀ on ADDITIONAL_PRINTER_QA.     -   K₁=UseExtParmsLicense_key. This key is constant for all of the         ADDITIONAL_PRINTER_QAs for a given license agreement between an         OEM and a Manufacturer/owner ComCo (this is not the same key as         PrintEngineLicense_key which is stored as K₀ in PRINTER_QA). K₁         has no write permissions to anything. ⁵This can be identical to         PrintEngineLicense_key in the PRINTER_QA if it is desirable         (unlikely) that upgraders can function on PRINTER_QAs as well as         ADDITIONAL_PRINTER_QAs

K₀ is used to allow writes to the various fields containing operating parameters in the ADDITIONAL_PRINTER_QA. The upgrader (ChipS) also needs to check the appropriate licensing parameters such as OEM_Id for validity.

K₁ is used to allow SoPEC to authenticate reads of the ink remaining and any other ink data. This is accomplished by having the same UseExtParmsLicense_key within PRINTER_QA (e.g. in K₂), also with no write permissions. i.e:

-   -   PRINTER_QA.K₂=UseExtParmsLicense_key. This key is constant for         all of the PRINTER_QAs for a given license agreement between an         OEM and a Manufacturer/owner ComCo. K₂ has no write permissions         to anything.

This means there are two shared keys, with PRINTER_QA sharing both, and thereby acting as a bridge between INK_QA and SoPEC.

-   -   UseExtParmsLicense_key is shared between PRINTER_QA and         ADDITIONAL_PRINTER_QA     -   SoPEC_id_key is shared between SoPEC and PRINTER_QA

All SoPEC has to do is do an authenticated read [6] from ADDITIONAL_PRINTER_QA, pass the data/signature to PRINTER_QA, let PRINTER_QA validate the data/signature, and get PRINTER_QA to produce a similar signature based on the shared SoPEC_id_key. It can do so using the Translate function. SoPEC can then compare PRINTER_QA's signature with its own calculated signature, and if the signatures match, the data from ADDITIONAL_PRINTER_QA must be valid, and can therefore be trusted. Once the data from ADDITIONAL_PRINTER_QA is known to be trusted, the various operating parameters such as OEM_Id can be checked for validity.

With respect to floating dongles i.e. dongles that can be used on any SoPEC, sometimes it is desirable to tie a dongle to a specific SoPEC.

Tying a QA_CHIP to be used only on a specific SoPEC can be easily accomplished by writing the PRINTER_QA's chipId (unique serial number) into an appropriate M₀ field on the ADDITIONAL_PRINTER_QA. The system software can detect the match and function appropriately. If there is no match, the software can ignore the data read from the ADDITIONAL_PRINTER_QA.

Although it is also possible to store the SoPEC_id_key in one of the keys within the dongle, this must be done in an environment where power will not be removed partway through the key update process (if power is removed during the key update there is a possibility that the dongle QA Chip may be rendered unusable, although this can be checked for after the power failure).

Although an OEM should only be able sell the licensed operating parameters for a given Print Engine, they must be able to assembly-line test⁶ or service/test the Print Engine with a different set of operating parameters e.g. a maximally upgraded Print Engine. ⁶This section is referring to assembly-line testing rather than development testing. An OEM can maximally upgrade a given Print Engine to allow developmental testing of their own OEM program code & mechanics.

Several different mechanisms can be employed to allow OEMs to test the upgraded capabilities of the Print Engine. At present it is unclear exactly what kind of assembly-line tests would be performed.

The simplest solution is to use an ADDITIONAL_PRINTER_QA (i.e. special dongle PRINTER_QA). The ADDITIONAL_PRINTER_QA would contain the operating parameters that maximally upgrade the printer as long as the dongle is connected to the SoPEC. The exact connection may be directly electrical (e.g. via the standard QA Chip connections) or may be over the USB connection to the printer test host depending on the nature of the test. The exact preferred connection is yet to be determined.

In the testing environment, the ADDITIONAL_PRINTER_QA also requires a numberOfImpressions field inside M₀, which is writeable by K₀. Before the SoPEC prints a page at the higher speed, it decrements the numberOfImpressions counter, performs an authenticated read to ensure the count was decremented, and then prints the page. In this way, the total number of pages that can be printed at high speed is reduced in the event of someone stealing the ADDITIONAL_PRINTER_QA device. It also means that multiple test machines can make use of the same ADDITIONAL_PRINTER_QA.

Manufacturer/owner O/S program code contains the OEM's asymmetric public key to ensure that the subsequent OEM program code is authentic—i.e. from the OEM. However given that SoPEC only contains a single root key, it is theoretically possible for different OEM's applications to be run identically physical Print Engines i.e. printer driver for OEM₁ run on an identically physical Print Engine from OEM₂.

To guard against this, the Manufacturer/owner O/S program code contains a PrintEngineLicense_id code (e.g. 16 bits) that matches the same named value stored as a fixed operating parameter in the PRINTER_QA (i.e. in M₁₊). As with all other operating parameters, the value of PrintEngineLicense_id is stored in PRINTER_QA (and any ADDITIONAL_PRINTER_QA devices) at the same time as the other various PRINTER_QA customizations are being applied, before being shipped to the OEM site. In this way, the OEMs can be sure of differentiating themselves through software functionality.

The Manufacturer/owner O/S must perform ink authentication during prints. Ink usage authentication makes use of counters in SoPEC that keep an accurate record of the exact number of dots printed for each ink.

The ink amount remaining in a given cartridge is stored in that cartridge's INK_QA chip. Other data stored on the INK_QA chip includes ink color, viscosity, Memjet firing pulse profile information, as well as licensing parameters such as OEM_Id, inkType, InkUsageLicense_Id, etc. This information is typically constant, and is therefore likely to be stored in M₁₊ within INK_QA.

Just as the Print Engine operating parameters are validated by means of PRINTER_QA, a given Print Engine license may only be permitted to function with specifically licensed ink. Therefore the software on SoPEC could contain a valid set of ink types, colors, OEM_Ids, InkUsageLicense_Ids etc. for subsequent matching against the data in the INK_QA.

SoPEC must be able to authenticate reads from the INK_QA, both in terms of ink parameters as well as ink remaining.

To authenticate ink a number of steps must be taken:

-   -   restrict access to dot counts     -   authenticate ink usage and ink parameters via INK_QA and         PRINTER_QA     -   broadcast ink dot usage to all SoPECs in a multi-SoPEC system

Since the dot counts are accessed via the PHI in the PEP section of SoPEC, access to these registers (and more generally all PEP registers) must be only available from supervisor mode, and not by OEM code (running in user mode). Otherwise it might be possible for OEM program code to clear dot counts before authentication has occurred. The basic problem of authentication of ink remaining and other ink data boils down to the problem that we don't trust INK_QA. Therefore how can a SoPEC know the initial value of ink (or the ink parameters), and how can a SoPEC know that after a write to the INK_QA, the count has been correctly decremented.

Taking the first issue, which is determining the initial ink count or the ink parameters, we need a system whereby a given SoPEC can perform an authenticated read of the data in INK_QA.

We cannot write the SoPEC_id_key to the INK_QA for two reasons:

-   -   updating keys is not power-safe (i.e. if power is removed         mid-update, the INK_QA could be rendered useless)     -   the ink cartridge would then not work in another printer since         the other printer would not know the old SoPEC_id_key (knowledge         of the old key is required in order to change the old key to a         new one).

The proposed solution is to let INK_QA have two keys:

-   -   K₀=SupplyInkLicense_key. This key is constant for all ink         cartridges for a given ink supply agreement between an OEM and a         Manufacturer/owner ComCo (this is not the same key as         PrintEngineLicense_key which is stored as K₀ in PRINTER_QA). K₀         has write permissions to the ink remaining regions of M₀ on         INK_QA.     -   K₁=UseInkLicense_key. This key is constant for all ink         cartridges for a given ink usage agreement between an OEM and a         Manufacturer/owner ComCo (this is not the same key as         PrintEngineLicense_key which is stored as K₀ in PRINTER_QA). K₁         has no write permissions to anything.

K₀ is used to authenticate the actual upgrades of the amount of ink remaining (e.g. to fill and refill the amount of ink). The fill and refill upgrader (ChipS) also needs to check the appropriate ink licensing parameters such as OEM_Id, InkType and InkUsageLicense_Id for validity.

K₁ is used to allow SoPEC to authenticate reads of the ink remaining and any other ink data. This is accomplished by having the same UseInkLicense_key within PRINTER_QA (e.g. in K₂ or K₃), also with no write permissions.

This means there are two shared keys, with PRINTER_QA sharing both, and thereby acting as a bridge between INK_QA and SoPEC.

-   -   UseInkLicense_key is shared between INK_QA and PRINTER_QA     -   SoPEC_id_key is shared between SoPEC and PRINTER_QA

All SoPEC has to do is do an authenticated read [6] from INK_QA, pass the data/signature to PRINTER_QA, let PRINTER_QA validate the data/signature and get PRINTER_QA to produce a similar signature based on the shared SoPEC_id_key (i.e. the Translate function [6]). SoPEC can then compare PRINTER_QA's signature with its own calculated signature (i.e. implement a Test function [6] in software on the SoPEC), and if the signatures match, the data from INK_QA must be valid, and can therefore be trusted.

Once the data from INK_QA is known to be trusted, the amount of ink remaining can be checked, and the other ink licensing parameters such as OEM_Id, InkType, InkUsageLicense_Id can be checked for validity.

In summary, the SoPEC performs the non-authenticated write of ink remaining to the INK_QA chip, and then performs an authenticated read of the data via the PRINTER_QA as per the pseudocode above. If the value is authenticated, and the INK_QA ink-remaining value matches the expected value, the count was correctly decremented and the printing can continue.

In a multi-SoPEC system, each SoPEC attached to a printhead must broadcast its ink usage to all the SoPECs. In this way, each SoPEC will have its own version of the expected ink usage.

In the case of a man-in-the-middle attack, at worst the count in a given SoPEC is only its own count (i.e. all broadcasts are turned into 0 ink usage by the man-in-the-middle). We would also require the broadcast amount to be treated as an unsigned integer to prevent negative amounts from being substituted.

A single SoPEC performs the update of ink remaining to the INK_QA chip, and then all SoPECs perform an authenticated read of the data via the appropriate PRINTER_QA (the PRINTER_QA that contains their matching SoPEC_id_key—remember that multiple SoPEC_id_keys can be stored in a single PRINTER_QA). If the value is authenticated, and the INK_QA value matches the expected value, the count was correctly decremented and the printing can continue.

If any of the broadcasts are not received, or have been tampered with, the updated ink counts will not match. The only case this does not cater for is if each SoPEC is tricked (via a USB2 inter-SoPEC-comms man-in-the-middle attack) into a total that is the same, yet not the true total. Apart from the fact that this is not viable for general pages, at worst this is the maximum amount of ink printed by a single SoPEC. We don't care about protecting against this case.

Since a typical maximum is 4 printing SoPECs, it requires at most 4 authenticated reads. This should be completed within 0.5 seconds, well within the 1-2 seconds/page print time. There must be a mapping of logical to physical since specific SoPECs are responsible for printing on particular physical parts of the page, and/or have particular devices attached to specific pins.

The identification process is mostly solved by general USB2 enumeration.

Each slave SoPEC will need to verify the boot broadcast messages received over USB2, and only execute the code if the signatures are valid. Several levels of authorization may occur. However, at some stage, this common program code (broadcast to all of the slave SoPECs and signed by the appropriate asymmetric private key) can, among other things, set the slave SoPEC's id relating to the physical location. If there is only 1 slave, the id is easy to determine, but if there is more than 1 slave, the id must be determined in some fashion. For example, physical location/id determination may be:

-   -   given by the physical USB2 port on the master     -   related to the physical wiring up of the USB2 interconnects     -   based on GPIO wiring. On other systems, a particular physical         arrangement of SoPECs may exist such that each slave SoPEC will         have a different set of connections on GPIOs. For example, one         SoPEC maybe in charge of motor control, while another may be         driving the LEDs etc. The unused GPIO pins (not necessarily the         same on each SoPEC) can be set as inputs and then tied to 0         or 1. As long as the connection settings are mutually exclusive,         program code can determine which is which, and the id         appropriately set.

This scheme of slave SoPEC identification does not introduce a security breach. If an attacker rewires the pinouts to confuse identification, at best it will simply cause strange printouts (e.g. swapping of printout data) to occur, while at worst the Print Engine will simply not function.

In use, each INK_QA chip needs the following keys:

-   -   K₀=SupplyInkLicense_key     -   K₁=UseInkLicense_key

Each PRINTER_QA chip tied to a specific SoPEC requires the following keys:

-   -   K₀=PrintEngineLicense_key     -   K₁=SoPEC_id_key     -   K₂=UseExtParmsLicense_key     -   K₃=UseInkLicense_key

Note that there may be more than one K₁ depending on the number of PRINTER_QA chips and SoPECs in a system. These keys need to be appropriately set up in the QA Chips before they will function correctly together.

When original QA Chips are shipped from QACo to a specific ComCo their keys are as follows:

-   -   K₀=QACo_ComCo_Key0     -   K₁=QACo_ComCo_Key1     -   K₂=QACo_ComCo_Key2     -   K₃=QACo_ComCo_Key3

All 4 keys are only known to QACo. Note that these keys are different for each QA Chip. The ComCo is responsible for making Print Engines out of Memjet printheads, QA Chips, PECs or SoPECs, PCBs etc.

In addition, the ComCo must customize the INK_QA chips and PRINTER_QA chip on-board the print engine before shipping to the OEM.

There are two stages:

-   -   replacing the keys in QA Chips with specific keys for the         application (i.e. INK_QA and PRINTER_QA)     -   setting operating parameters as per the license with the OEM

The ComCo is issued QID hardware by QACo that allows programming of the various keys (except for K₁) in a given QA Chip to the final values, following the standard ChipF/ChipP replace key (indirect version) protocol. The indirect version of the protocol allows each QACo_ComCo_Key to be different for each SoPEC.

In the case of programming of PRINTER_QA's K₁ to be SoPEC_id_key, there is the additional step of transferring an asymmetrically encrypted SoPEC_id_key (by the public-key) along with the nonce (R_(P)) used in the replace key protocol to the device that is functioning as a ChipF. The ChipF must decrypt the SoPEC_id_key so it can generate the standard replace key message for PRINTER_QA (functioning as a ChipP in the ChipF/ChipP protocol). The asymmetric key pair held in the ChipF equivalent should be unique to a ComCo (but still known only by QACo) to prevent damage in the case of a compromise.

Note that the various keys installed in the QA Chips (both INK_QA and PRINTER_QA) are only known to the QACo. The OEM only uses QIDs and QACo supplied ChipFs. The replace key protocol allows the programming to occur without compromising the old or new key.

There are two sets of operating parameters stored in PRINTER_QA and INK_QA:

-   -   fixed     -   upgradable

The fixed operating parameters can be written to by means of a non-authenticated writes to M₁₊ via a QID, and permission bits set such that they are ReadOnly.

The upgradable operating parameters can only be written to after the QA Chips have been programmed with the correct keys. Once they contain the correct keys they can be programmed with appropriate operating parameters by means of a QID and an appropriate ChipS (containing matching keys).

The QA Chip has a physical and a logical external interface. The physical interface defines how the QA Chip can be connected to a physical System, while the logical interface determines how that System can communicate with the QA Chip.

The QA Chip has four operating modes—Idle Mode, Program Mode, Trim Mode and Active Mode.

-   -   Idle Mode is used to allow the chip to wait for the next         instruction from the System.     -   Trim Mode is used to determine the clock speed of the chip and         to trim the frequency during the initial programming stage of         the chip (when Flash memory is garbage). The clock frequency         must be trimmed via Trim Mode before Program Mode is used to         store the program code.     -   Program Mode is used to load up the operating program code, and         is required because the operating program code is stored in         Flash memory instead of ROM (for security reasons).     -   Active Mode is used to execute the specific authentication         command specified by the System. Program code is executed in         Active Mode. When the results of the command have been returned         to the System, the chip enters Idle Mode to wait for the next         instruction.

The QA Chip starts up in Idle Mode. When the Chip is in Idle Mode, it waits for a command from the master by watching the primary id on the serial line.

-   -   If the primary id matches the global id (0x00, common to all QA         Chips), and the following byte from the master is the Trim Mode         id byte, the QA Chip enters Trim Mode and starts counting the         number of internal clock cycles until the next byte is received.     -   If the primary id matches the global id (0x00, common to all QA         Chips), and the following byte from the master is the Program         Mode id byte, the QA Chip enters Program Mode.     -   If the primary id matches the global id (0x00, common to all QA         Chips), and the following byte from the master is the Active         Mode id byte, the QA Chip enters Active Mode and executes         startup code, allowing the chip to set itself into a state to         receive authentication commands (includes setting a local id).     -   If the primary id matches the chip's local id, and the following         byte is a valid command code, the QA Chip enters Active Mode,         allowing the command to be executed.

The valid 8-bit serial mode values sent after a global id are specified to minimize the chances of them occurring by error after a global id (e.g. 0xFF and 0x00 are not used): Trim Mode is enabled by sending a global id byte (0x00) followed by the Trim Mode command byte.

The purpose of Trim Mode is to set the trim value (an internal register setting) of the internal ring oscillator so that Flash erasures and writes are of the correct duration. This is necessary due to the variation of the clock speed due to process variations. If writes an erasures are too long, the Flash memory will wear out faster than desired, and in some cases can even be damaged.

Trim Mode works by measuring the number of system clock cycles that occur inside the chip from the receipt of the Trim Mode command byte until the receipt of a data byte. When the data byte is received, the data byte is copied to the trim register and the current value of the count is transmitted to the outside world.

Once the count has been transmitted, the QA Chip returns to Idle Mode.

At reset, the internal trim register setting is set to a known value r. The external user can now perform the following operations:

-   -   send the global id+write followed by the Trim Mode command byte     -   send the 8-bit value v over a specified time t     -   send a stop bit to signify no more data     -   send the global id+read followed by the Trim Mode command byte     -   receive the count c     -   send a stop bit to signify no more data

At the end of this procedure, the trim register will be v, and the external user will know the relationship between external time t and internal time c. Therefore a new value for v can be calculated.

The Trim Mode procedure can be repeated a number of times, varying both t and v in known ways, measuring the resultant c. At the end of the process, the final value for v is established (and stored in the trim register for subsequent use in Program Mode). This value v must also be written to the flash for later use (every time the chip is placed in Active Mode for the first time after power-up).

Program Mode is enabled by sending a global id byte (0x00) followed by the Program Mode command byte.

The QA Chip determines whether or not the internal fuse has been blown (by reading 32-bit word 0 of the information block of flash memory).

If the fuse has been blown the Program Mode command is ignored, and the QA Chip returns to Idle Mode.

If the fuse is still intact, the chip enters Program Mode and erases the entire contents of Flash memory. The QA Chip then validates the erasure. If the erasure was successful, the QA Chip receives up to 4096 bytes of data corresponding to the new program code and variable data. The bytes are transferred in order byte₀ to byte₄₀₉₅.

Once all bytes of data have been loaded into Flash, the QA Chip returns to Idle Mode. Note that Trim Mode functionality must be performed before a chip enters Program Mode for the first time.

Once the desired number of bytes have been downloaded in Program Mode, the LSS Master must wait for 80 s (the time taken to write two bytes to flash at nybble rates) before sending the new transaction (eg Active Mode). Otherwise the last nybbles may not be written to flash.

Active Mode is entered either by receiving a global id byte (0x00) followed by the Active Mode command byte, or by sending a local id byte followed by a command opcode byte and an appropriate number of data bytes representing the required input parameters for that opcode.

In both cases, Active Mode causes execution of program code previously stored in the flash memory via Program Mode. As a result, we never enter Active Mode after Trim Mode, without a Program Mode in between. However once programmed via Program Mode, a chip is allowed to enter Active Mode after power-up, since valid data will be in flash.

If Active Mode is entered by the global id mechanism, the QA Chip executes specific reset startup code, typically setting up the local id and other IO specific data. If Active Mode is entered by the local id mechanism, the QA Chip executes specific code depending on the following byte, which functions as an opcode.

Apart from the Reset command, the next four commands are the commands most likely to be used during regular operation. The next three commands are used to provide authenticated writes (which are expected to be uncommon). The final set of commands (including SignM), are expected to be specially implemented on ChipS and ChipF QA Chips only. The input parameters are sent in the specified order, with each parameter being sent least significant byte first and most significant byte last.

Return (output) values are read in the same way—least significant byte first and most significant byte last. The client must know how many bytes to retrieve. The QA Chip will time out and return to Idle Mode if an incorrect number of bytes is provided or read. In most cases, the output bytes from one chip's command (the return values) can be fed directly as the input bytes to another chip's command. An example of this is the RND and RD commands. The output data from a call to RND on a trusted QA Chip does not have to be kept by the System. Instead, the System can transfer the output bytes directly to the input of the non-trusted QA Chip's RD command. The description of each command points out where this is so.

Note that some algorithms are specifically designed because flash memory is assumed for the implementation of non-volatile variables.

The memory within the QA Chip contains some non-volatile (Flash) memory to store the variables required by the authentication protocol. Note that since these variables are in Flash memory, writes should be minimized. The it is not a simple matter to write a new value to replace the old. Care must be taken with flash endurance, and speed of access. This has an effect on the algorithms used to change Flash memory based registers. For example, Flash memory should not be used as a shift register. A reset of the QA Chip has no effect on the non-volatile variables.

The base operating system clock SysClk is generated internally from a ring oscillator (process dependant). Since the frequency varies with operating temperature and voltage, the clock is passed through a temperature-based clock filter before use. The frequency is built into the chip during manufacture, and cannot be changed. The frequency is in the range 7-14 MHz.

Manufacturing comments are not normally made when normally describing the architecture of a chip. However, in the case of the QA Chip, the physical implementation of the chip is very much tied to the security of the key. Consequently a number of specialized circuits and components are necessary for implementation of the QA Chip. They are listed here.

-   -   Flash process     -   Internal randomized clock     -   Temperature based clock filter     -   Noise generator     -   Tamper Prevention and Detection circuitry     -   Protected memory with tamper detection     -   Boot-strap circuitry for loading program code     -   Data connections in polysilicon layers where possible     -   OverUnderPower Detection Unit     -   No scan-chains or BIST

The QA Chip is implemented with a standard Flash manufacturing process. It is important that a Flash process be used to ensure that good endurance is achieved (parts of the Flash memory can be erased/written many times).

To prevent clock glitching and external clock-based attacks, the operating clock of the chip should be generated internally. This can be conveniently accomplished by an internal ring oscillator. The length of the ring depends on the process used for manufacturing the chip.

Due to process and temperature variations, the clock needs to be trimmed to bring it into a range usable for timing of Flash memory writes and erases.

The internal clock should also contain a small amount of randomization to prevent attacks where light emissions from switching events are captured, as described below.

Finally, the generated clock must be passed through a temperature-based clock filter before being used by the rest of the chip.

The normal situation for FET implementation for the case of a CMOS inverter (which involves a pMOS transistor combined with an nMOS transistor).

During the transition, there is a small period of time where both the nMOS transistor and the pMOS transistor have an intermediate resistance. The resultant power-ground short circuit causes a temporary increase in the current, and in fact accounts for around 20% of current consumed by a CMOS device. A small amount of infrared light is emitted during the short circuit, and can be viewed through the silicon substrate (silicon is transparent to infrared light). A small amount of light is also emitted during the charging and discharging of the transistor gate capacitance and transmission line capacitance. For circuitry that manipulates secret key information, such information must be kept hidden.

Fortunately, IBM's PICA system and LVP (laser voltage probe) both have a requirement for repeatability due to the fact that the photo emissions are extremely weak (one photon requires more than 10⁵ switching events). PICA requires around 10⁹ pases to build a picture of the optical waveform. Similarly the LVP requires multiple passes to ensure an adequate SNR.

Randomizing the clock stops repeatability (from the point of view of collecting information about the same position in time), and therefore reduces the possibility of this attack. The QA Chip circuitry is designed to operate within a specific clock speed range. Although the clock is generated by an internal ring oscillator, the speed varies with temperature and power. Since the user supplies the temperature and power, it is possible for an attacker to attempt to introduce race-conditions in the circuitry at specific times during processing. An example of this is where a low temperature causes a clock speed higher than the circuitry is designed for, and this may prevent an XOR from working properly, and of the two inputs, the first may always be returned. The lesson to be learned from this is that the input power and operating temperature cannot be trusted.

Since the chip contains a specific power filter, we must also filter the clock. This can be achieved with a temperature sensor that allows the clock pulses through only when the temperature range is such that the chip can function correctly.

The filtered clock signal would be further divided internally as required.

Each QA Chip should contain a noise generator that generates continuous circuit noise. The noise will interfere with other electromagnetic emissions from the chip's regular activities and add noise to the Idd signal. Placement of the noise generator is not an issue on an QA Chip due to the length of the emission wavelengths.

The noise generator is used to generate electronic noise, multiple state changes each clock cycle, and as a source of pseudo-random bits for the Tamper Prevention and Detection circuitry.

A simple implementation of a noise generator is a 64-bit maximal period LFSR seeded with a non-zero number.

A set of circuits is required to test for and prevent physical attacks on the QA Chip. However what is actually detected as an attack may not be an intentional physical attack. It is therefore important to distinguish between these two types of attacks in an QA Chip:

-   -   where you can be certain that a physical attack has occurred.     -   where you cannot be certain that a physical attack has occurred.

The two types of detection differ in what is performed as a result of the detection. In the first case, where the circuitry can be certain that a true physical attack has occurred, erasure of flash memory key information is a sensible action. In the second case, where the circuitry cannot be sure if an attack has occurred, there is still certainly something wrong. Action must be taken, but the action should not be the erasure of secret key information. A suitable action to take in the second case is a chip RESET. If what was detected was an attack that has permanently damaged the chip, the same conditions will occur next time and the chip will RESET again. If, on the other hand, what was detected was part of the normal operating environment of the chip, a RESET will not harm the key.

A good example of an event that circuitry cannot have knowledge about, is a power glitch. The glitch may be an intentional attack, attempting to reveal information about the key. It may, however, be the result of a faulty connection, or simply the start of a powerdown sequence. It is therefore best to only RESET the chip, and not erase the key. If the chip was powering down, nothing is lost. If the System is faulty, repeated RESETs will cause the consumer to get the System repaired. In both cases the consumable is still intact. A good example of an event that circuitry can have knowledge about, is the cutting of a data line within the chip. If this attack is somehow detected, it could only be a result of a faulty chip (manufacturing defect) or an attack. In either case, the erasure of the secret information is a sensible step to take.

Consequently each QA Chip should have 2 Tamper Detection Lines—one for definite attacks, and one for possible attacks. Connected to these Tamper Detection Lines would be a number of Tamper Detection test units, each testing for different forms of tampering. In addition, we want to ensure that the Tamper Detection Lines and Circuits themselves cannot also be tampered with.

At one end of the Tamper Detection Line is a source of pseudo-random bits (clocking at high speed compared to the general operating circuitry). The Noise Generator circuit described above is an adequate source. The generated bits pass through two different paths—one carries the original data, and the other carries the inverse of the data. The wires carrying these bits are in the layer above the general chip circuitry (for example, the memory, the key manipulation circuitry etc.). The wires must also cover the random bit generator. The bits are recombined at a number of places via an XOR gate. If the bits are different (they should be), a 1 is output, and used by the particular unit (for example, each output bit from a memory read should be ANDed with this bit value). The lines finally come together at the Flash memory Erase circuit, where a complete erasure is triggered by a 0 from the XOR. Attached to the line is a number of triggers, each detecting a physical attack on the chip. Each trigger has an oversize nMOS transistor attached to GND. The Tamper Detection Line physically goes through this nMOS transistor. If the test fails, the trigger causes the Tamper Detect Line to become 0. The XOR test will therefore fail on either this clock cycle or the next one (on average), thus RESETing or erasing the chip. FIG. 23 illustrates the basic principle of a Tamper Detection Line in terms of tests and the XOR connected to either the Erase or RESET circuitry.

The Tamper Detection Line must go through the drain of an output transistor for each test, as illustrated by FIG. 24.

It is not possible to break the Tamper Detect Line since this would stop the flow of 1s and 0s from the random source. The XOR tests would therefore fail. As the Tamper Detect Line physically passes through each test, it is not possible to eliminate any particular test without breaking the Tamper Detect Line.

It is important that the XORs take values from a variety of places along the Tamper Detect Lines in order to reduce the chances of an attack. FIG. 25 illustrates the taking of multiple XORs from the Tamper Detect Line to be used in the different parts of the chip. Each of these XORs can be considered to be generating a ChipOK bit that can be used within each unit or sub-unit.

A typical usage would be to have an OK bit in each unit that is ANDed with a given ChipOK bit each cycle. The OK bit is loaded with 1 on a RESET. If OK is 0, that unit will fail until the next RESET. If the Tamper Detect Line is functioning correctly, the chip will either RESET or erase all key information. If the RESET or erase circuitry has been destroyed, then this unit will not function, thus thwarting an attacker.

The destination of the RESET and Erase line and associated circuitry is very context sensitive. It needs to be protected in much the same way as the individual tamper tests. There is no point generating a RESET pulse if the attacker can simply cut the wire leading to the RESET circuitry. The actual implementation will depend very much on what is to be cleared at RESET, and how those items are cleared.

Finally, FIG. 26 shows how the Tamper Lines cover the noise generator circuitry of the chip. The generator and NOT gate are on one level, while the Tamper Detect Lines run on a level above the generator.

It is not enough to simply store secret information or program code in flash memory. The Flash memory and RAM must be protected from an attacker who would attempt to modify (or set) a particular bit of program code or key information. The mechanism used must conform to being used in the Tamper Detection Circuitry (described above). The first part of the solution is to ensure that the Tamper Detection Line passes directly above each flash or RAM bit. This ensures that an attacker cannot probe the contents of flash or RAM. A breach of the covering wire is a break in the Tamper Detection Line. The breach causes the Erase signal to be set, thus deleting any contents of the memory. The high frequency noise on the Tamper Detection Line also obscures passive observation.

The second part of the solution for flash is to always store the data with its inverse. In each byte, 4 bits contains the data, and 4 bits (the shadow) contains the inverse of the data. If both are 0, this is a valid erase state, and the value is 0. Otherwise, the memory is only valid if the 4 bits of shadow are the inverse of the main 4 bits. The reasoning is that it is possible to add electrons to flash via a FIB, but not take electrons away. If it is possible to change a 0 to 1 for example, it is not possible to do the same to its inverse, and therefore regardless of the sense of flash, an attack can be detected.

The second part of the solution for RAM is to use a parity bit. The data part of the register can be checked against the parity bit (which will not match after an attack).

The bits coming from Flash and RAM can therefore be validated by a number of test units (one per bit) connected to the common Tamper Detection Line. The Tamper Detection circuitry would be the first circuitry the data passes through (thus stopping an attacker from cutting the data lines).

In addition, the data and program code should be stored in different locations for each chip, so an attacker does not know where to launch an attack. Finally, XORing the data coming in and going to Flash with a random number that varies for each chip means that the attacker cannot learn anything about the key by setting or clearing an individual bit that has a probability of being the key (the inverse of the key must also be stored somewhere in flash).

Finally, each time the chip is called, every flash location is read before performing any program code. This allows the flash tamper detection to be activated in a common spot instead of when the data is actually used or program code executed. This reduces the ability of an attacker to know exactly what was written to.

Program code should be kept in protected flash instead of ROM, since ROM is subject to being altered in a non-testable way. A boot-strap mechanism is therefore required to load the program code into flash memory (flash memory is in an indeterminate state after manufacture).

The boot-strap circuitry must not be in a ROM—a small state-machine suffices. Otherwise the boot code could be trivially modified in an undetectable way.

The boot-strap circuitry must erase all flash memory, check to ensure the erasure worked, and then load the program code.

The program code should only be executed once the flash program memory has been validated via Program Mode.

Once the final program has been loaded, a fuse can be blown to prevent further programming of the chip.

Wherever possible, the connections along which the key or secret data flows, should be made in the polysilicon layers. Where necessary, they can be in metal 1, but must never be in the top metal layer (containing the Tamper Detection Lines).

Each QA Chip requires an OverUnder Power Detection Unit (PDU) to prevent Power Supply Attacks. A PDU detects power glitches and tests the power level against a Voltage Reference to ensure it is within a certain tolerance. The Unit contains a single Voltage Reference and two comparators. The PDU would be connected into the RESET Tamper Detection Line, thus causing a RESET when triggered.

A side effect of the PDU is that as the voltage drops during a power-down, a RESET is triggered, thus erasing any work registers.

Test hardware on an QA Chip could very easily introduce vulnerabilities. In addition, due to the small size of the QA Chip logic, test hardware such as scan paths and BIST units could in fact take a sizeable chunk of the final chip, lowering yield and causing a situation where an error in the test hardware causes the chip to be unusable. As a result, the QA Chip should not contain any BIST or scan paths. Instead, the program memory must first be validated via the Program Mode mechanism, and then a series of program tests run to verify the remaining parts of the chip.

FIG. 27 shows a high level block diagram of the QA Chip. Note that the tamper prevention and detection circuitry is not shown.

FIG. 28 shows a block diagram of the Analogue Unit.

The operating clock of the chip (SysClk) is generated by an internal ring oscillator whose frequency can be trimmed to reduce the variation from 4:1 (due to process and temperature) down to 2:1 (temperature variations only) in order to satisfy the timing requirements of the Flash memory.

The length of the ring depends on the process used for manufacturing the chip. A nominal operating frequency range of 10 MHz is sufficient. This clock should contain a small amount of randomization to prevent attacks where light emissions from switching events are captured.

Note that this is different to the input SClk which is the serial clock for external communication.

The ring oscillator is covered by both Tamper Detection and Prevention lines so that if an attacker attempts to tamper with the unit, the chip will either RESET or erase all secret information.

The voltage reference block maintains an output which is substantially independent of process, supply voltage and temperature. It provides a reference voltage which is used by the PDU and a reference current to stabilise the ring oscillator. It may also be used as part of the temperature based clock filter.

The Under Voltage Detection Unit provides the signal PwrFailing which, if asserted, indicates that the power supply may be turning off. This signal is used to rapidly terminate any Flash write that may be in progress to avoid accidentally writing to an indeterminate memory location.

Note that the PDU triggers the RESET Tamper Detection Line only. It does not trigger the Erase Tamper Detection Line.

The PDU can be implemented with regular CMOS, since the key does not pass through this unit. It does not have to be implemented with non-flashing CMOS.

The PDU is covered by both Tamper Detection and Prevention lines so that if an attacker attempts to tamper with the unit, the chip will either RESET or erase all secret information.

The Power-on Reset unit (POR) detects a power-on condition and generates the PORstL signal that is fed to all the validation units, including the two inside the Tamper Detect Unit (TDU).

All other logic is connected to RstL, which is the PORstL gated by the VAL unit attached to the Reset tamper detection lines within the TDU. Therefore, if the Reset tamper line is asserted, the validation will drive RstL low, and can only be cleared by a power-down. If the tamper line is not asserted, then RstL=PORstL.

The TDU contains a second VAL unit attached to the Erase tamper detection lines within the TDU. It produces a TamperEraseOK signal that is output to the MWU (1=the tamper lines are all OK, 0=force an erasure of Flash).

The Noise Generator (NG) is based on a 64-bit maximal period LFSR loaded with a set non-zero bit pattern on RESET.

The NG must be protected by both Tamper Detection and Prevention lines so that if an attacker attempts to tamper with the unit, the chip will either RESET or erase all secret information.

In addition, the bits in the LFSR must be validated to ensure they have not been tampered with (i.e. a parity check). If the parity check fails, the Erase Tamper Detection Line is triggered.

Finally, all 64 bits of the NG are ORed into a single bit. If this bit is 0, the Erase Tamper Detection Line is triggered. This is because 0 is an invalid state for an LFSR.

The 8-bit Trim register within the Trim Unit has a reset value of 0x00 (to enable the flash reads to succeed even in the fastest process corners), and is written to either by the PMU during Trim Mode or by the CPU in Active Mode. Note that the CPU is only able to write once to the Trim register between power-on-reset due to the TrimDone flag which provides overloading of LocalIdWE.

The reset value of Trim (0) means that the chip has a nominal frequency of 2.7 MHz-10 MHz. The upper of the range is when we cannot trim it lower than this (or we could allow some spread on the acceptable trimmed frequency but this will reduce our tolerance to ageing, voltage and temperature which is the range 7 MHz to 14 MHz). The 2.7 MHz value is determined by a chip whose oscillator runs at 10 MHz when the trim register is set to its maximum value, so then it must run at 2.7 MHz when trim=0. This is based on the non-linear frequency-current characteristic of the oscillator. Chips found outside of these limits will be rejected.

The frequency of the ring oscillator is measured by counting cycles⁷, in the PMU, over the byte period of the serial interface. The frequency of the serial clock, SClk, and therefore the byte period will be accurately controlled during the measurement. The cycle count (Fineas) at the end of the period is read over the serial bus and the Trim register updated (Trimval) from its power on default (POD) value. The steps are shown in FIG. 29. Multiple measure—read—trim cycles are possible to improve the accuracy of the trim procedure. ⁷Note that the PMU counts using 12-bits, saturates at 0xFFF, and returns the cycle count divided by 2 as an 8-bit value. This means that multiple measure-read-trim cycles may be necessary to resolve any amibguity. In any case, multiple cycles are necessary to test the correctness of the trim circuitry during manufacture test.

A single byte for both Fineas and Trimval provide sufficient accuracy for measurement and trimming of the frequency. If the bus operates at 400 kHz, a byte (8 bits) can be sent in 20 s. By dividing the maximum oscillator frequency, expected to be 20 MHz, by 2 results in a cycle count of 200 and 50 for the minimum frequency of 5 MHz resulting in a worst case accuracy of 2%.

FIG. 30 shows a block diagram of the Trim Unit:

The 8-bit Trim value is used in the analog Trim Block to adjust the frequency of the ring oscillator by controlling its bias current. The two lsbs are used as a voltage trim, and the 6 msbs are used as a frequency trim.

The Central Processing Unit (CPU) block provides the majority of the circuitry of the 4-bit microprocessor. FIG. 31 shows a high level view of the block.

The Memory Interface Unit (MIU) provides the interface to flash and RAM. The MIU contains a Program Mode Unit that allows flash memory to be loaded via the IOU, a Memory Request Unit that maps 8-bit and 32-bit requests into multiple byte based requests, and a Memory Access Unit that generates read/write strobes for individual accesses to the memory.

FIG. 32 shows a high level view of the MIU block.

The Memory Components block isolates the memory implementation from the rest of the QA Chip.

The entire contents of the Memory Components block must be protected from tampering. Therefore the logic must be covered by both Tamper Detection Lines. This is to ensure that program code, keys, and intermediate data values cannot be changed by an attacker.

The 8-bit wide RAM also needs to be parity-checked.

FIG. 33 shows a high level view of the Memory Components block. It consists of 8 KBytes of flash memory and 3072 bits of parity checked RAM.

A single Flash memory block is used to hold all non-volatile data. This includes program code and variables. The Flash memory block is implemented by TSMC component SFC0008_(—)08B9_HE, which has the following characteristics:

-   -   8K×8-bit main memory, plus 128×8-bit information memory     -   512 byte page erase     -   Endurance of 20,000 cycles (min)     -   Greater than 100 years data retention at room temperature     -   Access time: 20 ns (max)     -   Byte write time: 20 s (min)     -   Page erase time: 20 ms (min)     -   Device erase time: 200 ms (min)     -   Area of 0.494 mm² (724.66 m×682.05 m)

The FlashCtrl line are the various inputs on the SFC0008_(—)08B9_HE required to read and write bytes, erase pages and erase the device. A total of 9 bits are required.

Flash values are unchanged by a RESET. After manufacture, the Flash contents must be considered to be garbage. After an erasure, the Flash contents in the SFC0008_(—)08B9_HE is all 1s.

The I/O Unit (IOU) is responsible for providing the physical implementation of the logical interface moving between the various modes (Idle, Program, Trim and Active) according to commands sent by the master.

The IOU therefore contains the circuitry for communicating externally with the external world via the SClk and SDa pins. The IOU sends and receives data in 8-bit chunks. Data is sent serially, most significant bit (bit 7) first through to least significant bit (bit 0) last. When a master sends a command to an QA Chip, the command commences with a single byte containing an id in bits 7-1, and a read/write sense in bit 0, as shown in FIG. 34. The IOU recognizes a global id of 0x00 and a local id of LocalId (set after the CPU has executed program code at reset or due to a global id/ActiveMode command on the serial bus). Subsequent bytes contain modal information in the case of global id, and command/data bytes in the case of a match with the local id.

If the master sends data too fast, then the IOU will miss data, since the IOU never holds the bus. The meaning of too fast depends on what is running. In Program Mode, the master must send data a little slower than the time it takes to write the byte to flash (actually written as 2×8-bit writes, or 40 s). In ActiveMode, the master is permitted to send and request data at rates up to 500 KHz.

None of the latches in the IOU need to be parity checked since there is no advantage for an attacker to destroy or modify them.

The IOU outputs 0s and inputs 0s if either of the Tamper Detection Lines is broken. This will only come into effect if an attacker has disabled the RESET and/or erase circuitry, since breaking either Tamper Detection Lines should result in a RESET or the erasure of all Flash memory.

The IOU's InByte, InByteValid, OutByte, and OutByteValid registers are used for communication between the master and the QA Chip. InByte and InByteValid provide the means for clients to pass commands and data to the QA Chip. OutByte and OutByteValid provide the means for the master to read data from the QA Chip.

-   -   Reads from InByte should wait until InByteValid is set.         InByteValid will remain clear until the master has written the         next input byte to the QA Chip. When the IOU is told (by the FEU         or MU) that InByte has been read, the IOU clears the InByteValid         bit to allow the next byte to be read from the client.     -   Writes to OutByte should wait until OutByteValid is clear.         Writing OutByte sets the OutByteValid bit to signify that data         is available to be transmitted to the master. OutByteValid will         then remain set until the master has read the data from OutByte.         If the master requests a byte but OutByteValid is clear, the IOU         sends a NAck to indicate the data is not yet ready.

When the chip is reset via RstL, the IOU enters ActiveMode to allow the PMU to run to load the fuse. Once the fuse has been loaded (when MIUAvail transitions from 0 to 1) the IOU checks to see if the program is known to be safe. If it is not safe, the IOU reverts to IdleMode. If it is safe (FuseBlown=1), the IOU stays in ActiveMode to allow the program to load up the localId and do any other reset initialization, and will not process any further serial commands until the CPU has written a byte to the OutByte register (which may be read or not at the discretion of the master using a localId read). In both cases the master is then able to send commands to the QA Chip.

FIG. 35 shows a block diagram of the IOU.

With regards to InByteValid inputs, set has priority over reset, although both set and reset in correct operation should never be asserted at the same time. With regards to IOSetInByte and IOLoadInByte, if IOSetInByte is asserted, it will set InByte to be 0xFF regardless of the setting of IOLoadInByte.

The two VAL units are validation units connected to the Tamper Prevention and Detection circuitry, each with an OK bit. The OK bit is set to 1 on PORstL, and ORed with the ChipOK values from both Tamper Detection Lines each cycle. The OK bit is ANDed with each data bit that passes through the unit.

In the case of VAL₁, the effective byte output from the chip will always be 0 if the chip has been tampered with. Thus no useful output can be generated by an attacker. In the case of VAL₂, the effective byte input to the chip will always be 0 if the chip has been tampered with. Thus no useful input can be chosen by an attacker.

There is no need to verify the registers in the IOU since an attacker does not gain anything by destroying or modifying them.

The current mode of the IOU is output as a 2-bit IOMode to allow the other units within the QA Chip to take correct action.

The Logic blocks generate a 1 if the current IOMode is in Program Mode, Active Mode or Trim Mode respectively. The logic blocks are:

The Program Counter Unit (PCU) includes the 12 bit PC (Program Counter), as well as logic for branching and subroutine control.

The PCU latches need to be parity-checked. In addition, the logic and registers contained in the PCU must be covered by both Tamper Detection Lines to ensure that the PC cannot be changed by an attacker.

The PC is implemented as a 12 entry by 12-bit PCA (PC Array), indexed by a 4-bit SP (Stack Pointer) register. The PC, PCRamSel and SP registers are all cleared to 0 on a RstL, and updated during the flow of program control according to the opcodes.

The current value for the PC is normally updated during the Execute cycle according to the command being executed. However it is also incremented by 1 during the Fetch cycle for two byte instructions such as JMP, JSR, DBR, TBR, and instructions that require an additional byte for immediate addressing. The mechanism for calculating the new PC value depends upon the opcode being processed.

FIG. 41 shows a block diagram of the PCU:

The ADD block is a simple adder modulo 2¹² with two inputs: an unsigned 12 bit number and an 8-bit signed number (high bit=sign). The signed input is either a constant of 0x01, or an 8-bit offset (the 8 bits from the MIU).

The “+1” block takes a 4-bit input and increments it by 1 (modulo 12). The “−1” block takes a 4-bit input and decrements it by 1 (modulo 12).

The Address Generator Unit (AGU) generates effective addresses for accessing the Memory Unit (MU). In Cycle 0, the PC is passed through to the MU in order to fetch the next opcode. The AGU interprets the returned opcode in order to generate the effective address for Cycle 1. In Cycle 1, the generated address is passed to the MU.

The logic and registers contained in the AGU must be covered by both Tamper Detection Lines. This is to ensure that an attacker cannot alter any generated address. The latches for the counters and calculated address should also be parity-checked.

If either of the Tamper Detection Lines is broken, the AGU will generate address 0 each cycle and all counters will be fixed at 0. This will only come into effect if an attacker has disabled the RESET and/or erase circuitry, since under normal circumstances, breaking a Tamper Detection Line will result in a RESET or the erasure of all Flash memory.

The block diagram for the AGU is shown in FIG. 42:

The accessMode and WriteMask registers must be cleared to 0 on reset to ensure that no access to memory occurs at startup of the CPU.

The Adr and accessMode registers are written to during the final cycle of cycle 0 (Fetch) and cycle 1 (Exec) with the address to use during the following cycle phase. For example, when cycle=1, the PC is selected so that it can be written to Adr during Exec. During cycle 0, while the PC is being output from Adr, the address to be used in the following cycle 1 is calculated (based on the fetched opcode seen as Cmd) and finally stored in Adr when Fetch is 1. The accessMode register is also updated in the same way.

It is important to distinguish between the value of Cmd during different values for Cycle:

During Cycle 0, when Fetch is 1, the 8-bit input Cmd holds the instruction to be executed in the following Cycle 1. This 8-bit value is used to decode the effective address for the operand of the instruction.

During Cycle 1, when Exec is 1, Cmd holds the currently executing instruction.

The WriteMask register is only ever written to during execution of an appropriate ROR instruction. Logic, sets the WriteMask and MMR WriteEnables respectively based on this condition:

Logic₁ Exec

Cmd⁷⁻⁰ = ROR WriteMask)

The data written to the WriteMask register is the lower 8 bits of the Accumulator.

The Address Register Unit is only updated by an RIA or LIA instruction, so the writeEnable is generated by Logic₂ as follows:

Logic₂ Exec

(Cmd⁶⁻³ = 1111)

The Counter Unit (CU) generates counters C1, C2 and the selected N index. In addition, the CU outputs a CZ flag for use by the PCU. The CU is described in more detail below. The VAL₁ unit is a validation unit connected to the Tamper Prevention and Detection circuitry). It contains an OK bit that is set to 1 on PORstL, and ORed with the ChipOK values from both Tamper Detection Lines each cycle. The OK bit is ANDed with the 12 bits of Adr before they can be used. If the chip has been tampered with, the address output will be always 0, thereby preventing an attacker from accessing other parts of memory. The VAL₁ unit also performs a parity check on the Adr Address bits to ensure it has not been tampered with. If the parity-check fails, the Erase Tamper Detection Line is triggered.

The Program Mode Unit (PMU) is responsible for Program Mode and Trim Mode operations:

-   -   Program Mode involves erasing the existing flash memory and         loading the new program/data into the flash. The program that is         loaded can be a bootstrap program if desired, and may contain         additional program code to produce a digital signature of the         final program to verify that the program was written correctly         (e.g. by producing a SHA-1 signature of the entire flash         memory).     -   Trim Mode involves counting the number of internal cycles that         have elapsed between the entry of Trim Mode (at the falling edge         of the ack) and the receipt of the next byte (at the falling         edge of the last bit before the ack) from the Master. When the         byte is received, the current count value divided by 2 is         transmitted to the Master.

The PMU relies on a fuse (implemented as the value of word 0 of the flash information block) to determine whether it is allowed to perform Program Mode operations. The purpose of this fuse is to prevent easy (or accidental) reprogramming of QA Chips once their purpose has been set. For example, an attacker may want to reuse chips from old consumables. If an attacker somehow bypasses the fuse check, the PMU will still erase all of flash before storing the desired program. Even if the attacker somehow disconnects the erasure logic, they will be unable to store a program in the flash due to the shadow nybbles.

The PMU contains an 8-bit buff register that is used to hold the byte being written to flash and a 12-bit adr register that is used to hold the byte address currently being written to. The PMU is also used to load word 1 of the information block into a 32-bit register (combined from 8-bits of buff, 12-bits of adr, and a further 12-bit register) so it can be used to XOR all data to and from memory (both Flash and RAM) for future CPU accesses. This logic is activated only when the chip enters ActiveMode (so as not to access flash and possibly cause an erasure directly after manufacture since shadows will not be correct). The logic and 32-bit mask register is in the PMU to minimize chip area.

The PMU therefore has an asymmetric access to flash memory:

-   -   writes are to main memory     -   reads are from information block memory

The reads and writes are automatically directed appropriately in the MRU.

A block diagram of the PMU is shown in FIG. 44.

The Memory Access Unit (MAU) takes memory access control signals and turns them into RAM accesses and flash access strobed signals with appropriate duration.

A new transaction is given by MRUNewTrans. The address to be read from or written to is on MRUAdr, which is a nybble-based address. The MRUAdr (13-bits) is used as-is for Flash addressing. When MRURAMSel=1, then the RAM address (RAMAdr) is taken from bits 9-3 of MRUAdr. The data to be written is on MRUData.

The return value MAURdy is set when the MAU is capable of receiving a new transaction the following cycle. Thus MAURdy will be 1 during the final cycle of a flash or ram access, and should be 1 when the MAU is idle. MAURdy should only be 0 during startup or when a transaction has yet to finish.

The MAU consists of logic that calculates MAURdy, and additional logic that produces the various strobed signals according to the TSMC Flash memory SFC0008_(—)08B9_HE. Both main memory and information blocks can be accessed in the Flash.

The MAU can be considered to be a RAM control block and a flash control block, with appropriate action selected by MRURAMSel. For all modes except read, the Flash requires wait states (which are implemented with a single counter) during which it is possible to access the RAM. Only 1 transaction may be pending while waiting for the wait states to expire. Multiple bytes may be written to Flash without exiting the write mode.

The MAU ensures that only valid control sequences meeting the timing requirements of the Flash memory are provided. A write time-out is included which ensures the Flash cannot be left in write mode indefinitely; this is used when the Flash is programmed via the IO Unit to ensure the X address does not change while in write mode. Otherwise, other units should ensure that when writing bytes to Flash, the X address does not change. The X address is held constant by the MAU during write and page erase modes to protect the Flash. If an X address change is detected by the MAU during a Flash write sequence, it will exit write mode allowing the X address to change and re-enter write mode. Thus, the data will still be written to Flash but it will take longer.

When either the Flash or RAM is not being used, the MAU sets the control signals to put the particular memory type into standby to minimise power consumption.

The MAU assumes no new transactions can start while one is in progress and all inputs must remain constant until MAU is ready.

MAU also enables the Flash test mode register to be programmed which allows various production tests to be carried out. If MRUTestWE=1, transactions are directed towards the test mode register. Most of the tests use the same control sequences that are used for normal operation except that one time value needs to be changed. This is provided by the flashTime register that can be written to by the CPU allowing the timer to be set to a range of values up to more than 1 second. A special control sequence is generated when the test mode register is set to 0x1E and is initiated by writing to the Flash.

Note that on reset, timeSel and flashTime are both cleared to 0. The 5-bit flash test register within the TSMC flash IP is also reset by setting TMR=1. When MRUTestWE=1, any open write sequence is closed even if the write is not to the 5-bit flash test register within the TSMC flash IP.

Power could fail at any time; the most serious consequence would be if this occurred during writing to the Flash and data became corrupted in another location to that being written to. The MAU will protect the Flash by switching off the charge pump (high voltage supply used for programming and erasing) as soon as the power starts to fail. After a time delay of about 5 s (programmable), to allow the discharge of the charge pump, the QA chip will be reset whether or not the power supply recovers.

Circuits need to operate over the temperature range −40° C. to +125° C. The analogue unit provides power on reset, protection of the Flash memory against erroneous writes during power down (in conjunction with the MAU) and the system clock SysClk.

The table below shows the key thresholds for V_(DD) which define the requirements for power on reset and normal operation.

TABLE 1 V_(DD) limits VDD parameter Description Voltage VDDFTmax Flash test maximum 3.6⁸ VDDFTtyp Flash test typical 3.3 VDDFTmin Flash test minimum 3.0 VDDmax Normal operation maximum (typ + 10%) 2.75⁹ VDDtyp Normal operation typical 2.5 VDDmin Normal operation minimum (typ − 5%) 2.375 VDDPORmax Power on reset maximum 2.0¹⁰ ⁸The voltage VDDFT may only be applied for the times specified in the TSMC Flash memory test document. ⁹Voltage regulators used to derive VDD will typically have symmetric tolerance limits ¹⁰The minimum allowable voltage for Flash memory operation.

The voltage reference circuit generates a stable voltage that is approximately independent of PVT (process, voltage, temperature) and will typically be implemented as a bandgap. Usually, a startup circuit is required to avoid the stable V_(bg)=0 condition. The design should aim to minimise the additional voltage above V_(bg) required for the circuit to operate. An additional output, BGOn, will be provided and asserted when the bandgap has started and indicates to other blocks that the output voltage is stable and may be used. The power detection unit provides over and under voltage detection. With under voltage detection two outputs are required:

-   -   underL controls the power on reset; and     -   PwrFailing indicates possible failure of the power supply.

Both signals are derived by comparing scaled versions of V_(DD) against the reference voltage V_(bg).

The rising and falling edges of V_(DD) (from the external power supply) shall be monotonic in order to guarantee correct operation of power on reset and power failing detection. Random noise may be present but should have a peak to peak amplitude of less than the hysteresis of the comparators used for detection in the PDU.

The underL signal of the under voltage detection unit generates the global reset to the logic which should be de-asserted when the supply voltage is high enough for the logic and analogue circuits to operate. Since the logic reset is asynchronous, it is not necessary to ensure the clock is active before releasing the reset or to include any delay.

The QA chip logic will start immediately the power on reset is released so this should only be done when the conditions of supply voltage and clock frequency are within limits for the correct operation of the logic.

The power on reset signal shall not be triggered by narrow spikes (<100 ns) on the power supply. Some immunity should be provided to power supply glitches although since the QA chip may be under attack, any reset delay should be kept short. The unit should not be triggered by logic dynamic current spikes resulting in short voltage spikes due to bond wire and package inductance.

On the rising edge of V_(DD), the maximum threshold for de-asserting the signal shall be when V_(DD)>V_(DDmin). On the falling edge of V_(DD), the minimum threshold for asserting the signal shall be V_(DD)<V_(DDPORmax).

The reset signal must be held low long enough (T_(pwmin)) to ensure all flip-flops are reset. The standard cell data sheet gives a figure of 0.73 ns for the minimum width of the reset pulse for all flip-flop types.

2 bits of trimming (trim₁₋₀) will be provided to take up all of the error in the bandgap voltage. This will only affect the assertion of the reset during power down since the power on default setting must be used during power up.

Although the reference voltage cannot be directly measured, it is compared against V_(DD) in the PDU. The state of the power on reset signal can be inferred by trying to communicate through the serial bus with the chip. By polling the chip and slowly increasing V_(DD), a point will be reached where the power on reset is released allowing the serial bus to operate; this voltage should be recorded. As V_(DD) is lowered, it will cross the threshold which asserts the reset signal. The power on default is set to the lowest voltage that can be trimmed (which gives the maximum hysterisis). This voltage should be recorded (or it may be sufficient to estimate it from the reset release voltage recorded above). V_(DD) is then increased above the reset release threshold and the PDU trim adjusted to the setting the closest to V_(DDPORmaX). V_(DD) should then be lowered and the threshold at which the reset is re-asserted confirmed.

TABLE 2 Power on reset target performance Parameter Conditions Min Typ Max Units Vthrup T = 27° C. 2.0 2.375 V Vthrdn T = 27° C. 2.0 2.1 V Vhystmin 16 mV IDD 5 A Tspike 100 ns Vminr 0.5 V Tpwmin 1 ns

The signal PwrFailing will be used to protect the Flash memory by turning off the charge pump during a write or page erase if the supply voltage drops below a certain threshold. The charge pump is expected to take about 5us to discharge. The PwrFailing signal shall be protected against narrow spikes (<100 ns) on the power supply.

The nominal threshold for asserting the signal needs to be in the range V_(PORmax)<V_(DDPFtyp)<V_(DDmin) so is chosen to be asserted when V_(DD)<V_(DDPFtyp)=V_(DDPORmaX)+200 mV. This infers a V_(DD) slew rate limitation which must be <200 mV/5 us to ensure enough time to detect that power is failing before the supply drops too low and the reset is activated. This requirement must be met in the application by provision of adequate supply decoupling or other means to control the rate of descent of V_(DD).

TABLE 3 Power failing detection target performance Parameter Conditions Min Typ Max Units Vthr T = 27° C. 2.1 2.2 2.3 V¹¹ Vhyst 16 mV IDD 5 A Tspike 100 ns Vminr 0.5 V ¹¹These limits are after trimming and include an allowance for VDD ramping.

2 bits of trimming (trim₁₋₀) will be provided to take up all of the error in the bandgap voltage.

SysClk is required to be in the range 7-14 MHz throughout the lifetime of the circuit provided V_(DD) is maintained within the range V_(DDMIN)<V_(DD)<V_(DDMAX). The 2:1 range is derived from the programming time requirements of the TSMC Flash memory. If this range is exceeded, the useful lifetime of the Flash may be reduced.

The first version of the QA chip, without physical protection, does not require the addition of random jitter to the clock. However, it is recommended that the ring oscillator be designed in such a way as to allow for the addition of jitter later on with minimal modification. In this way, the un-trimmed centre frequency would not be expected to change.

The initial frequency error must be reduced to remain within the range 10 MHz/1.41 to 10 MHz×1.41 allowing for variation in:

-   -   voltage     -   temperature     -   ageing     -   added jitter     -   errors in frequency measurement and setting accuracy

The range budget must be partitioned between these variables.

FIG. 49 shows the ring oscillator block diagram

The above arrangement allows the oscillator centre frequency to be trimmed since the bias current of the ring oscillator is controlled by the DAC. SysClk is derived by dividing the oscillator frequency by 5 which makes the oscillator smaller and allows the duty cycle of the clock to be better controlled.

Using V_(bg), this block sources a current that can be programmed by the Trim signal. 6 of the available 8 trim bits will be used (trim₇₋₂) giving a clock adjustment resolution of about 250 kHz. The range of current should be such that the ring oscillator frequency can be adjusted over a 4 to 1 range.

TABLE 4 Programmable current source target performance Parameter Conditions Min Typ Max Units Iout Trim7-2 = 0 5 A Trim7-2 = 32 12.5 Trim7-2 = 63 20 Vrefin 1.23 V Rout Trim7-2 = 63 2.5 M

TABLE 5 Ring oscillator target performance Parameter Conditions Min Typ Max Units Fosc¹² 7 10 14 MHz IDD 10 A KI 1 MHz/A KVDD +200 KHz/V KT +30 KHz/° C. Vstart 1.5 V K_(I) = control sensitivity, K_(VDD) = V_(DD) sensitivity, K_(T) = temperature sensitivity ¹²Accounting for division by 5

With the figures above, K_(VDD) will give rise to a maximum variation of ±50 kHz and K_(T) to ±1.8 MHz over the specified range of V_(DD) and temperature.

The ring oscillator will be prescaled by 5 to obtain the nominal 10 MHz clock. An asynchronous design may be used to save power. Several divided clock duty cycles are obtainable, eg 4:1, 3:2 etc. To ease timing requirements for the standard cell logic block, the following clock will be generated; most flip-flops will operate on the rising edge of the clock allowing negative edge clocking to meet memory timing.

TABLE 6 Div5 target performance Parameter Conditions Min Typ Max Units Fmax Vdd = 1.5 V 100 MHz IDD 10 A

This block combines the overL (omitted from the current version), underL and MAURstOutL signals to provide the global reset. MAURstOutL is delayed by one clock cycle to ensure a reset generated when this signal is asserted has at least this duration since the reset deasserts the signal itself. It should be noted that the register, with active low reset RN, is the only one in the QA chip not connected to RstL. 

1. An integrated circuit comprising: a memory storing first and second strings of bit values, each bit value in the second string being the logical inverse of a bit value at a corresponding bit position in the first string; and a processor configured to test whether the bit values of the second string are the inverse of the bit values at respective corresponding bit positions of the first string by combining the corresponding bits of the first and second strings.
 2. An integrated circuit according to claim 1, configured and programmed to perform a defensive action in the event the test fails.
 3. An integrated circuit according to claim 2, wherein the defensive action includes deleting or destroying some or all of the contents of the memory in the event the test fails.
 4. An integrated circuit according to claim 3, wherein the defensive action includes deleting or destroying the first and/or second strings.
 5. An integrated circuit according to claim 3, wherein the defensive action includes preventing the processor from executing software.
 6. An integrated circuit according to claim 3, wherein the defensive action includes resetting some or all of logic on the integrated circuit.
 7. An integrated circuit according to claim 1, wherein the first and second strings are stored at different sub-addresses within the same address of the memory. 